Bug 633232 nsIMIMEService.getTypeFromURI(null) crashes [@ nsExternalHelperAppService::GetTypeFromURI(nsIURI*, nsACString_internal&) ]
authortimeless@mozdev.org
Wed, 27 Apr 2011 10:13:27 +0200
changeset 68789 42768e2b3a4c58cea86ae90032d0632272476c8c
parent 68788 c17c9e2c88454380b1702fbea13e52330ad7a287
child 68790 225fff91e7adb81b4adf0267dd2dbfeaf3afc6b7
push id99
push usereakhgari@mozilla.com
push dateTue, 24 May 2011 18:03:59 +0000
treeherdermozilla-aurora@26d6981b3d6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs633232
milestone6.0a1
Bug 633232 nsIMIMEService.getTypeFromURI(null) crashes [@ nsExternalHelperAppService::GetTypeFromURI(nsIURI*, nsACString_internal&) ] r=biesi
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -2795,16 +2795,17 @@ NS_IMETHODIMP nsExternalHelperAppService
   if (NS_FAILED(rv))
     return rv;
 
   return mi->GetPrimaryExtension(_retval);
 }
 
 NS_IMETHODIMP nsExternalHelperAppService::GetTypeFromURI(nsIURI *aURI, nsACString& aContentType) 
 {
+  NS_ENSURE_ARG_POINTER(aURI);
   nsresult rv = NS_ERROR_NOT_AVAILABLE;
   aContentType.Truncate();
 
   // First look for a file to use.  If we have one, we just use that.
   nsCOMPtr<nsIFileURL> fileUrl = do_QueryInterface(aURI);
   if (fileUrl) {
     nsCOMPtr<nsIFile> file;
     rv = fileUrl->GetFile(getter_AddRefs(file));