From f8b3a2e93cb998e181457f3fecd30066454bbc66 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 1 Nov 2023 04:24:42 +0100 Subject: [PATCH] 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. --- quickjs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickjs.c b/quickjs.c index 3696011c..d662eb35 100644 --- a/quickjs.c +++ b/quickjs.c @@ -15005,6 +15005,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,