[njs] Fixed incorrect optimization in njs_string_to_c_string().

Alexander Borisov alexander.borisov at nginx.com
Mon Jul 15 14:45:45 UTC 2019


details:   https://hg.nginx.org/njs/rev/3b3e3c133d13
branches:  
changeset: 1047:3b3e3c133d13
user:      Alexander Borisov <alexander.borisov at nginx.com>
date:      Mon Jul 15 17:45:23 2019 +0300
description:
Fixed incorrect optimization in njs_string_to_c_string().

diffstat:

 njs/njs_string.c |  4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diffs (14 lines):

diff -r e89f5a5709e0 -r 3b3e3c133d13 njs/njs_string.c
--- a/njs/njs_string.c	Mon Jul 15 16:20:41 2019 +0300
+++ b/njs/njs_string.c	Mon Jul 15 17:45:23 2019 +0300
@@ -3942,10 +3942,6 @@ njs_string_to_c_string(njs_vm_t *vm, njs
     } else {
         start = value->long_string.data->start;
         size = value->long_string.size;
-
-        if (start[size] == '\0') {
-            return start;
-        }
     }
 
     data = nxt_mp_alloc(vm->mem_pool, size + 1);


More information about the nginx-devel mailing list