[tor-commits] [tor-browser/tor-browser-45.1.1esr-6.0-1] Bug 19212: SIGSEGV with developer tools open

gk at torproject.org gk at torproject.org
Fri Jun 3 06:57:05 UTC 2016


commit d7f98ce46b9cc43bb4ec8482938cb04f6ca99e21
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Thu Jun 2 15:45:36 2016 -0400

    Bug 19212: SIGSEGV with developer tools open
    
    Avoid a crash when monitoring network events. The crash occurred
    because the JS context's compartment was NULL when a JS stack was
    requested, but the root cause remains a mystery.
---
 js/src/jsapi.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index adbee56..46418ba 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6223,7 +6223,9 @@ JS_PUBLIC_API(bool)
 JS::CaptureCurrentStack(JSContext* cx, JS::MutableHandleObject stackp, unsigned maxFrameCount)
 {
     JSCompartment* compartment = cx->compartment();
-    MOZ_ASSERT(compartment);
+    if (!compartment)
+      return false;
+
     Rooted<SavedFrame*> frame(cx);
     if (!compartment->savedStacks().saveCurrentStack(cx, &frame, maxFrameCount))
         return false;





More information about the tor-commits mailing list