]> git.kaiwu.me - njs.git/commitdiff
Fixed incorrect pointer check in njs_json_parse_string().
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 27 Apr 2018 11:19:45 +0000 (14:19 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 27 Apr 2018 11:19:45 +0000 (14:19 +0300)
Found by Coverity (CID 14351611435162).
The bug appeared in 29eee021e03e.

njs/njs_json.c

index 71c9b7a0ee2a04b67320e4481205f02d7cb49ddd..24d585ba5d342234ff66fb75a0338031c433647e 100644 (file)
@@ -741,7 +741,7 @@ njs_json_parse_string(njs_json_parse_ctx_t *ctx, njs_value_t *value,
         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;
         }