From: Ben Noordhuis Date: Wed, 1 Nov 2023 03:24:42 +0000 (+0100) Subject: Fix sloppy mode arguments uninitialized value use X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=e140122202cc24728b394f8f90fa2f4a2d7c397e;p=quickjs.git 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. --- diff --git a/quickjs.c b/quickjs.c index 3e9f4b3..1e82615 100644 --- a/quickjs.c +++ b/quickjs.c @@ -14774,6 +14774,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,