[njs] Fixed potential NULL-pointer dereference (CID 1455631).

Dmitry Volyntsev xeioex at nginx.com
Wed Nov 13 12:49:26 UTC 2019


details:   https://hg.nginx.org/njs/rev/96d99066e8e5
branches:  
changeset: 1235:96d99066e8e5
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Nov 13 15:31:41 2019 +0300
description:
Fixed potential NULL-pointer dereference (CID 1455631).

diffstat:

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

diffs (13 lines):

diff -r a6aef1897687 -r 96d99066e8e5 src/njs_json.c
--- a/src/njs_json.c	Wed Nov 13 15:19:49 2019 +0300
+++ b/src/njs_json.c	Wed Nov 13 15:31:41 2019 +0300
@@ -2169,6 +2169,9 @@ njs_vm_value_dump(njs_vm_t *vm, njs_str_
     njs_memset(stringify->space.start, ' ', indent);
 
     state = njs_json_push_stringify_state(vm, stringify, value);
+    if (njs_slow_path(state == NULL)) {
+        goto memory_error;
+    }
 
     for ( ;; ) {
         switch (state->type) {


More information about the nginx-devel mailing list