Skip to content

Commit

Permalink
Fix sloppy mode arguments uninitialized value use
Browse files Browse the repository at this point in the history
MemorySanitizer complained about uninitialized reads in
the indexed property code path in JS_GetPropertyValue()
with JS_CLASS_MAPPED_ARGUMENTS objects.
  • Loading branch information
bnoordhuis committed Nov 1, 2023
1 parent 67585d0 commit f8b3a2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f8b3a2e

Please sign in to comment.