Skip to content
Snippets Groups Projects
Commit 77b90b5f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Zero-init write buffer in js_writebin()

CID 350276
parent 31864868
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment