Welcome! Log In Create A New Profile

Advanced

[njs] Fixed use-of-uninitialized-value for the global this object.

Dmitry Volyntsev
January 17, 2020 07:20AM
details: https://hg.nginx.org/njs/rev/ef8c8f65ac0e
branches:
changeset: 1304:ef8c8f65ac0e
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Jan 16 21:29:43 2020 +0300
description:
Fixed use-of-uninitialized-value for the global this object.

Found by MemorySanitizer.

diffstat:

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

diffs (12 lines):

diff -r 6017c94f59b2 -r ef8c8f65ac0e src/njs_builtin.c
--- a/src/njs_builtin.c Thu Jan 16 19:18:41 2020 +0300
+++ b/src/njs_builtin.c Thu Jan 16 21:29:43 2020 +0300
@@ -373,6 +373,8 @@ njs_builtin_objects_clone(njs_vm_t *vm,
}

vm->global_object.__proto__ = object_prototype;
+
+ njs_set_undefined(global);
njs_set_object(global, &vm->global_object);

vm->string_object = vm->shared->string_object;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed use-of-uninitialized-value for the global this object.

Dmitry Volyntsev 272 January 17, 2020 07:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 211
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready