Skip to content
Snippets Groups Projects
Commit 5b1bf568 authored by rswindell's avatar rswindell
Browse files

Initialize arglist to NULLs in js_printf(), eliminates GPFs if incorrect number of args for fmt.

parent 72c34eac
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,8 @@ js_printf(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if((fmt = JS_ValueToString(cx, argv[0]))==NULL)
return(JS_FALSE);
memset(arglist,0,sizeof(arglist)); // Initialize arglist to NULLs
for (i = 1; i < argc && i<sizeof(arglist)/sizeof(arglist[0]); i++) {
if(JSVAL_IS_STRING(argv[i])) {
if((str=JS_ValueToString(cx, argv[i]))==NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment