Bug 1038887 - Add back null check to nsErrorService::GetErrorStringBundle. r=froydnj, a=sledru
authorAndrew McCreight <continuation@gmail.com>
Fri, 25 Jul 2014 16:41:24 -0700
changeset 208194 f1b3abcc9555
parent 208193 eb3c7dd5ac83
child 208195 97a654ff8682
push id3761
push userryanvm@gmail.com
push date2014-07-29 19:29 +0000
treeherdermozilla-beta@f1b3abcc9555 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, sledru
bugs1038887
milestone32.0
Bug 1038887 - Add back null check to nsErrorService::GetErrorStringBundle. r=froydnj, a=sledru
content/xml/content/crashtest/1038887.xhtml
content/xml/content/crashtest/crashtests.list
xpcom/base/nsErrorService.cpp
new file mode 100644
--- /dev/null
+++ b/content/xml/content/crashtest/1038887.xhtml
@@ -0,0 +1,1 @@
+<?xml-stylesheet type="text/xsl" href="http://notexistingurl"?><html xmlns="http://www.w3.org/1999/xhtml"></html>
--- a/content/xml/content/crashtest/crashtests.list
+++ b/content/xml/content/crashtest/crashtests.list
@@ -1,3 +1,4 @@
 load 420429.xul
 load 453278.html
 load 803586.xhtml
+load 1038887.xhtml
--- a/xpcom/base/nsErrorService.cpp
+++ b/xpcom/base/nsErrorService.cpp
@@ -33,13 +33,16 @@ nsErrorService::UnregisterErrorStringBun
   mErrorStringBundleURLMap.Remove(aErrorModule);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsErrorService::GetErrorStringBundle(int16_t aErrorModule, char** aResult)
 {
   nsCString* bundleURL = mErrorStringBundleURLMap.Get(aErrorModule);
+  if (!bundleURL) {
+    return NS_ERROR_FAILURE;
+  }
   *aResult = ToNewCString(*bundleURL);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////