[njs] Fixed use-of-uninitialized-value while tracking rejected promises.

Dmitry Volyntsev xeioex at nginx.com
Tue Jun 8 17:59:58 UTC 2021


details:   https://hg.nginx.org/njs/rev/06204b343066
branches:  
changeset: 1653:06204b343066
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Jun 08 12:43:13 2021 +0000
description:
Fixed use-of-uninitialized-value while tracking rejected promises.

Found by Found by MemorySanitizer.

diffstat:

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

diffs (12 lines):

diff -r 45b9af3f911f -r 06204b343066 src/njs_promise.c
--- a/src/njs_promise.c	Sat Jun 05 11:55:08 2021 +0000
+++ b/src/njs_promise.c	Tue Jun 08 12:43:13 2021 +0000
@@ -570,7 +570,7 @@ njs_promise_host_rejection_tracker(njs_v
         length = vm->promise_reason->length;
 
         for (i = 0; i < length; i++) {
-            if (memcmp(&value[i], &data->result, sizeof(njs_value_t)) == 0) {
+            if (njs_values_same(&value[i], &data->result)) {
                 length--;
 
                 if (i < length) {


More information about the nginx-devel mailing list