about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2023-11-01 04:24:42 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-02 18:12:23 +0100
commit00757d71489dd07a23c2e2fbc63f9bbdb5833fd1 (patch)
tree86f7153c8c4c742a2a2bc414a1cee48a9d009204 /lib
parent85a311a69bd517913ce8c4f275b9690aaacbcec3 (diff)
downloadchawan-00757d71489dd07a23c2e2fbc63f9bbdb5833fd1.tar.gz
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 (limited to 'lib')
-rw-r--r--lib/quickjs/quickjs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c
index a1445f84..40329b23 100644
--- a/lib/quickjs/quickjs.c
+++ b/lib/quickjs/quickjs.c
@@ -14827,6 +14827,8 @@ static JSValue js_build_arguments(JSContext *ctx, int argc, JSValueConst *argv)
     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,