[njs] Fixed incorrect pointer check in njs_json_parse_string().

Dmitry Volyntsev xeioex at nginx.com
Fri Apr 27 11:20:54 UTC 2018


details:   http://hg.nginx.org/njs/rev/809a919a2f5a
branches:  
changeset: 513:809a919a2f5a
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Apr 27 14:19:45 2018 +0300
description:
Fixed incorrect pointer check in njs_json_parse_string().

Found by Coverity (CID 1435161, 1435162).
The bug appeared in 29eee021e03e.

diffstat:

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

diffs (12 lines):

diff -r ea220019d249 -r 809a919a2f5a njs/njs_json.c
--- a/njs/njs_json.c	Thu Apr 26 20:22:04 2018 +0300
+++ b/njs/njs_json.c	Fri Apr 27 14:19:45 2018 +0300
@@ -741,7 +741,7 @@ njs_json_parse_string(njs_json_parse_ctx
         p = start;
 
         dst = nxt_mem_cache_alloc(ctx->pool, size);
-        if (nxt_slow_path(start == NULL)) {
+        if (nxt_slow_path(dst == NULL)) {
             njs_memory_error(ctx->vm);;
             return NULL;
         }


More information about the nginx-devel mailing list