Bug 678988 - "potential null pointer dereference in js/jsd/jsd_scpt.c" [r=sphink]
authorAtul Aggarwal <atulagrwl>
Sun, 28 Aug 2011 07:48:00 -0700
changeset 76222 0cf9208a2bb55fb47c3c0eb0efe3783a8f51e198
parent 76221 a513e2816eaf5d55964ddd990c86c768da0ec520
child 76223 6eaa9655a1cf37f0a3ff614a2d3d744869edfca4
push id1572
push usersfink@mozilla.com
push dateTue, 30 Aug 2011 19:03:39 +0000
treeherdermozilla-inbound@0cf9208a2bb5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssphink
bugs678988
milestone9.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 678988 - "potential null pointer dereference in js/jsd/jsd_scpt.c" [r=sphink]
js/jsd/jsd_scpt.c
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -525,18 +525,20 @@ jsd_GetScriptLineExtent(JSDContext* jsdc
 }
 
 jsuword
 jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line)
 {
     jsuword pc;
     JSCrossCompartmentCall *call;
 
+    if( !jsdscript )
+        return 0;
 #ifdef LIVEWIRE
-    if( jsdscript && jsdscript->lwscript )
+    if( jsdscript->lwscript )
     {
         uintN newline;
         jsdlw_RawToProcessedLineNumber(jsdc, jsdscript, line, &newline);
         if( line != newline )
             line = newline;
     }
 #endif