[njs] A fix in decodeURI() and decodeURIComponent() functions.

Igor Sysoev igor at sysoev.ru
Wed Aug 31 16:28:32 UTC 2016


details:   http://hg.nginx.org/njs/rev/715b147cbfe0
branches:  
changeset: 166:715b147cbfe0
user:      Igor Sysoev <igor at sysoev.ru>
date:      Wed Aug 31 19:28:08 2016 +0300
description:
A fix in decodeURI() and decodeURIComponent() functions.

diffstat:

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

diffs (23 lines):

diff -r 584114a51b51 -r 715b147cbfe0 njs/njs_string.c
--- a/njs/njs_string.c	Wed Aug 31 19:18:47 2016 +0300
+++ b/njs/njs_string.c	Wed Aug 31 19:28:08 2016 +0300
@@ -2317,8 +2317,8 @@ njs_string_decode(njs_vm_t *vm, njs_valu
 {
     int8_t               d0, d1;
     u_char               byte, *start, *src, *dst;
-    size_t               n, size;
-    ssize_t              length;
+    size_t               n;
+    ssize_t              size, length;
     nxt_bool_t           utf8;
     njs_string_prop_t    string;
 
@@ -2358,7 +2358,7 @@ njs_string_decode(njs_vm_t *vm, njs_valu
 
             size -= 2;
 
-            if (size == 0) {
+            if (size <= 0) {
                 goto uri_error;
             }
 



More information about the nginx-devel mailing list