Bug 900987 - Handle a null category argument to nsScriptError::Init without crashing; pending-r=bholley
authorMs2ger <ms2ger@gmail.com>
Sun, 04 Aug 2013 11:18:41 +0200
changeset 153611 559400867e9292ce31354202d07f34581ace55be
parent 153610 a58abd7408bfe4cf9e1005b511da9ecce42b68ad
child 153612 620bbab02c0bef95e53dbebe560714412d46dffe
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs900987
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 900987 - Handle a null category argument to nsScriptError::Init without crashing; pending-r=bholley
js/xpconnect/src/nsScriptError.cpp
--- a/js/xpconnect/src/nsScriptError.cpp
+++ b/js/xpconnect/src/nsScriptError.cpp
@@ -97,19 +97,21 @@ NS_IMETHODIMP
 nsScriptError::Init(const nsAString& message,
                     const nsAString& sourceName,
                     const nsAString& sourceLine,
                     uint32_t lineNumber,
                     uint32_t columnNumber,
                     uint32_t flags,
                     const char *category)
 {
-    nsDependentCString c(category);
     return InitWithWindowID(message, sourceName, sourceLine, lineNumber,
-                            columnNumber, flags, c, 0);
+                            columnNumber, flags,
+                            category ? nsDependentCString(category)
+                                     : EmptyCString(),
+                            0);
 }
 
 NS_IMETHODIMP
 nsScriptError::InitWithWindowID(const nsAString& message,
                                 const nsAString& sourceName,
                                 const nsAString& sourceLine,
                                 uint32_t lineNumber,
                                 uint32_t columnNumber,