[njs] Fixed use-of-uninitialized-value in njs_string_index().

Dmitry Volyntsev xeioex at nginx.com
Fri Jun 11 18:28:41 UTC 2021


details:   https://hg.nginx.org/njs/rev/db7696b86a9c
branches:  
changeset: 1659:db7696b86a9c
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Jun 11 18:28:21 2021 +0000
description:
Fixed use-of-uninitialized-value in njs_string_index().

Found by MemorySanitizer.

diffstat:

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

diffs (12 lines):

diff -r a0f5719c8d9a -r db7696b86a9c src/njs_string.c
--- a/src/njs_string.c	Fri Jun 11 15:47:37 2021 +0000
+++ b/src/njs_string.c	Fri Jun 11 18:28:21 2021 +0000
@@ -2565,7 +2565,7 @@ njs_string_index(njs_string_prop_t *stri
     last = 0;
     index = 0;
 
-    if (string->length >= NJS_STRING_MAP_STRIDE) {
+    if (string->length > NJS_STRING_MAP_STRIDE) {
 
         end = string->start + string->size;
         map = njs_string_map_start(end);


More information about the nginx-devel mailing list