Bug 646380 - jsd_GetValueString needs to null out 'call' after leaving the cross compartment call (r=sphink a=dveditz)
authorLuke Wagner <luke@mozilla.com>
Tue, 12 Apr 2011 19:42:52 +0100
changeset 63419 debc1ec252229e602575ad47bfa70acd9b3c56e4
parent 63418 1ae9e61776a894acc28309914d92c26f2880a714
child 63420 ad48178a0e9e196fdc0ce6657561d9cd7d436df9
push id63
push userneil@parkwaycc.co.uk
push dateTue, 12 Apr 2011 18:44:04 +0000
reviewerssphink, dveditz
bugs646380
milestone2.0.1pre
Bug 646380 - jsd_GetValueString needs to null out 'call' after leaving the cross compartment call (r=sphink a=dveditz)
js/jsd/jsd_val.c
--- a/js/jsd/jsd_val.c
+++ b/js/jsd/jsd_val.c
@@ -235,16 +235,17 @@ jsd_GetValueString(JSDContext* jsdc, JSD
         return NULL;
     }
     exceptionState = JS_SaveExceptionState(cx);
 
     string = JS_ValueToString(cx, jsdval->val);
 
     JS_RestoreExceptionState(cx, exceptionState);
     JS_LeaveCrossCompartmentCall(call);
+    call = NULL;
 
     if(string) {
         stringval = STRING_TO_JSVAL(string);
         call = JS_EnterCrossCompartmentCall(cx, jsdc->glob);
     }
     if(!string || !call || !JS_WrapValue(cx, &stringval)) {
         if(call)
             JS_LeaveCrossCompartmentCall(call);