[njs] Fixed invalid NULL pointer check.

Vadim Zhestikov v.zhestikov at f5.com
Wed Mar 22 16:38:15 UTC 2023


details:   https://hg.nginx.org/njs/rev/8e6a2cb0c23d
branches:  
changeset: 2075:8e6a2cb0c23d
user:      Vadim Zhestikov <v.zhestikov at f5.com>
date:      Wed Mar 22 09:36:58 2023 -0700
description:
Fixed invalid NULL pointer check.

This fixes Coverity issues CID 1524495 and CID 1524494.

diffstat:

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

diffs (14 lines):

diff -r edf1c2aef957 -r 8e6a2cb0c23d src/njs_parser.c
--- a/src/njs_parser.c	Mon Mar 20 21:25:47 2023 -0700
+++ b/src/njs_parser.c	Wed Mar 22 09:36:58 2023 -0700
@@ -8030,8 +8030,8 @@ njs_parser_export(njs_parser_t *parser, 
             return NJS_DONE;
         }
 
-        peek = njs_lexer_peek_token(parser->lexer, peek, 1);
-        if (njs_slow_path(token == NULL)) {
+        peek = njs_lexer_peek_token(parser->lexer, peek, 0);
+        if (njs_slow_path(peek == NULL)) {
             return NJS_ERROR;
         }
 


More information about the nginx-devel mailing list