[njs] Fixed dead store assignment in TextEncoder.encodeInto().

noreply at nginx.com noreply at nginx.com
Tue Oct 8 04:35:02 UTC 2024


details:   https://github.com/nginx/njs/commit/34e322521508cba30bafc5cc60063a82ca358312
branches:  master
commit:    34e322521508cba30bafc5cc60063a82ca358312
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue, 24 Sep 2024 22:07:44 -0700
description:
Fixed dead store assignment in TextEncoder.encodeInto().

Found by Clang static analyzer.

---
 src/njs_encoding.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/njs_encoding.c b/src/njs_encoding.c
index 98a73338..f70c084d 100644
--- a/src/njs_encoding.c
+++ b/src/njs_encoding.c
@@ -204,7 +204,6 @@ njs_text_encoder_encode_into(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
     to = njs_typed_array_start(array);
     to_end = to + array->byte_length;
 
-    cp = 0;
     njs_set_number(&read, 0);
     njs_set_number(&written, 0);
 


More information about the nginx-devel mailing list