commit 34fefeeecd3f2464cd404852731e43fca8689142
parent 7af9f356658e555c379deb380602554d1a902aed
Author: Ben Noordhuis <info@bnoordhuis.nl>
Date: Wed, 1 Nov 2023 04:24:42 +0100
Fix sloppy mode arguments uninitialized value use
MemorySanitizer complained about uninitialized reads in
the indexed property code path in JS_GetPropertyValue()
with JS_CLASS_MAPPED_ARGUMENTS objects.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/quickjs/quickjs.c b/quickjs/quickjs.c
@@ -14789,6 +14789,8 @@ static JSValue js_build_mapped_arguments(JSContext *ctx, int argc,
if (JS_IsException(val))
return val;
p = JS_VALUE_GET_OBJ(val);
+ p->u.array.u.values = NULL;
+ p->u.array.count = 0;
/* add the length field (cannot fail) */
pr = add_property(ctx, p, JS_ATOM_length,