Commit 77b90b5f authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Zero-init write buffer in js_writebin()

CID 350276
parent 31864868
...@@ -1882,7 +1882,7 @@ js_writebin(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1882,7 +1882,7 @@ js_writebin(JSContext *cx, uintN argc, jsval *arglist)
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE); return(JS_TRUE);
} }
buffer=malloc(size*count); buffer=calloc(size, count);
if(buffer==NULL) { if(buffer==NULL) {
rc=JS_SUSPENDREQUEST(cx); rc=JS_SUSPENDREQUEST(cx);
dbprintf(TRUE, p, "malloc failure of %u bytes", size*count); dbprintf(TRUE, p, "malloc failure of %u bytes", size*count);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment