[njs] Fixed return value for string base64/base64url encoding.

Alexander Borisov alexander.borisov at nginx.com
Wed Aug 26 18:26:59 UTC 2020


details:   https://hg.nginx.org/njs/rev/fbee1514cf43
branches:  
changeset: 1506:fbee1514cf43
user:      Alexander Borisov <alexander.borisov at nginx.com>
date:      Wed Aug 26 21:11:03 2020 +0300
description:
Fixed return value for string base64/base64url encoding.

diffstat:

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

diffs (21 lines):

diff -r b98eb205a37b -r fbee1514cf43 src/njs_string.c
--- a/src/njs_string.c	Wed Aug 26 21:05:46 2020 +0300
+++ b/src/njs_string.c	Wed Aug 26 21:11:03 2020 +0300
@@ -317,7 +317,7 @@ njs_string_base64(njs_vm_t *vm, njs_valu
 
     dst.length = njs_base64_encoded_length(src->length);
 
-    dst.start = njs_string_alloc(vm, &vm->retval, dst.length, dst.length);
+    dst.start = njs_string_alloc(vm, value, dst.length, dst.length);
     if (njs_slow_path(dst.start == NULL)) {
         return NJS_ERROR;
     }
@@ -348,7 +348,7 @@ njs_string_base64url(njs_vm_t *vm, njs_v
 
     dst.length = njs_base64_encoded_length(src->length) - padding;
 
-    dst.start = njs_string_alloc(vm, &vm->retval, dst.length, dst.length);
+    dst.start = njs_string_alloc(vm, value, dst.length, dst.length);
     if (njs_slow_path(dst.start == NULL)) {
         return NJS_ERROR;
     }


More information about the nginx-devel mailing list