Bug 1101264: Truncate long sourceName messages since they can be massive data: URLs. r=bent
authorDavid Major <dmajor@mozilla.com>
Fri, 25 Sep 2015 15:55:34 -0400
changeset 264480 4c0e0c5176e9c8ece837393a916f8ef52f4dc473
parent 264479 27e9d9dfc369b87b80029b824a1c651aed8fbdc6
child 264481 9d4b733346a784bee059b5e493a9091957aceeec
push id65646
push userdmajor@mozilla.com
push dateFri, 25 Sep 2015 19:55:56 +0000
treeherdermozilla-inbound@4c0e0c5176e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1101264
milestone44.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 1101264: Truncate long sourceName messages since they can be massive data: URLs. r=bent
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -432,16 +432,19 @@ ConsoleListener::Observe(nsIConsoleMessa
         rv = scriptError->GetSourceLine(sourceLine);
         NS_ENSURE_SUCCESS(rv, rv);
 
         // Before we send the error to the parent process (which
         // involves copying the memory), truncate any long lines.  CSS
         // errors in particular share the memory for long lines with
         // repeated errors, but the IPC communication we're about to do
         // will break that sharing, so we better truncate now.
+        if (sourceName.Length() > 1000) {
+            sourceName.Truncate(1000);
+        }
         if (sourceLine.Length() > 1000) {
             sourceLine.Truncate(1000);
         }
 
         rv = scriptError->GetCategory(getter_Copies(category));
         NS_ENSURE_SUCCESS(rv, rv);
         rv = scriptError->GetLineNumber(&lineNum);
         NS_ENSURE_SUCCESS(rv, rv);