Commits

portix committed 6bd421d

Fixing wrong argument evaluated in frame.inject

The the global-argument in frame.inject was evaluated as the line
number, injected scripts could be leaking into the website if line number was
given.

Comments (0)

Files changed (1)

     JSValueRef ret = NIL;
     gboolean global = false;
     JSValueRef args[1];
+    JSValueRef e = NULL;
     JSObjectRef f;
     JSStringRef script;
     char *name = NULL;
     if (argc > 2)
         debug = JSValueToNumber(ctx, argv[2], exc);
     if (argc > 3 && JSValueIsBoolean(ctx, argv[3])) 
-        global = JSValueToBoolean(ctx, argv[2]);
+        global = JSValueToBoolean(ctx, argv[3]);
 
     if (JSValueIsObject(ctx, argv[0]) && (f = js_value_to_function(ctx, argv[0], exc)) != NULL)
     {
     }
 
 
-    JSValueRef e = NULL;
     if (global) 
         JSEvaluateScript(wctx, script, NULL, NULL, 0, &e);
     else