[njs] Fixed Object.prototype.constructor property handler with large heap.

Dmitry Volyntsev xeioex at nginx.com
Tue May 24 05:27:36 UTC 2022


details:   https://hg.nginx.org/njs/rev/f37972e95e17
branches:  
changeset: 1861:f37972e95e17
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon May 23 22:26:35 2022 -0700
description:
Fixed Object.prototype.constructor property handler with large heap.

Found by Memory Sanitizer.

diffstat:

 src/njs_object.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r beb180165976 -r f37972e95e17 src/njs_object.c
--- a/src/njs_object.c	Thu May 19 16:41:08 2022 -0700
+++ b/src/njs_object.c	Mon May 23 22:26:35 2022 -0700
@@ -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;



More information about the nginx-devel mailing list