[njs] Fixed uninitialized field in njs_vm_value_dump().

Dmitry Volyntsev xeioex at nginx.com
Tue Jun 18 14:57:57 UTC 2019


details:   https://hg.nginx.org/njs/rev/2cb51aab7e78
branches:  
changeset: 1007:2cb51aab7e78
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Jun 18 17:57:22 2019 +0300
description:
Fixed uninitialized field in njs_vm_value_dump().

MemorySanitizer: use-of-uninitialized-value in
njs_json_push_stringify_state().

diffstat:

 njs/njs_json.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r c3a70f0f6cdc -r 2cb51aab7e78 njs/njs_json.c
--- a/njs/njs_json.c	Fri Jun 14 21:20:25 2019 +0300
+++ b/njs/njs_json.c	Tue Jun 18 17:57:22 2019 +0300
@@ -2375,6 +2375,7 @@ njs_vm_value_dump(njs_vm_t *vm, nxt_str_
     stringify->nodes = NULL;
     stringify->last = NULL;
     stringify->stack.items = 0;
+    stringify->replacer = njs_value_undefined;
 
     if (!njs_dump_is_object(value)) {
         ret = njs_dump_value(stringify, value, console);


More information about the nginx-devel mailing list