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 76226 0cf9208a2bb55fb47c3c0eb0efe3783a8f51e198
parent 76225 a513e2816eaf5d55964ddd990c86c768da0ec520
child 76227 6eaa9655a1cf37f0a3ff614a2d3d744869edfca4
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerssphink
bugs678988
milestone9.0a1
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