]> git.kaiwu.me - njs.git/commitdiff
Fixed Object.prototype.constructor property handler with large heap.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 24 May 2022 05:26:35 +0000 (22:26 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 24 May 2022 05:26:35 +0000 (22:26 -0700)
Found by Memory Sanitizer.

src/njs_object.c

index ad03bc32fe5044049982606b016f3da1c21a28ce..c517614606d60d7ccd4f20e9c1c39b7c00263e8a 100644 (file)
@@ -1849,7 +1849,7 @@ njs_int_t
 njs_object_prototype_create(njs_vm_t *vm, njs_object_prop_t *prop,
     njs_value_t *value, njs_value_t *setval, njs_value_t *retval)
 {
-    int32_t            index;
+    int64_t            index;
     njs_function_t     *function;
     const njs_value_t  *proto;
 
@@ -2194,7 +2194,7 @@ njs_int_t
 njs_object_prototype_create_constructor(njs_vm_t *vm, njs_object_prop_t *prop,
     njs_value_t *value, njs_value_t *setval, njs_value_t *retval)
 {
-    int32_t                 index;
+    int64_t                 index;
     njs_value_t             *cons, constructor;
     njs_object_t            *object;
     njs_object_prototype_t  *prototype;