changeset 166:715b147cbfe0

A fix in decodeURI() and decodeURIComponent() functions.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 31 Aug 2016 19:28:08 +0300
parents 584114a51b51
children af6c17324584
files njs/njs_string.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 {
     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 @@
 
             size -= 2;
 
-            if (size == 0) {
+            if (size <= 0) {
                 goto uri_error;
             }