Welcome! Log In Create A New Profile

Advanced

[njs] A fix in decodeURI() function.

August 31, 2016 12:20PM
details: http://hg.nginx.org/njs/rev/584114a51b51
branches:
changeset: 165:584114a51b51
user: Igor Sysoev <igor@sysoev.ru>
date: Wed Aug 31 19:18:47 2016 +0300
description:
A fix in decodeURI() function.

diffstat:

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

diffs (23 lines):

diff -r 76f16f0ef6c5 -r 584114a51b51 njs/njs_string.c
--- a/njs/njs_string.c Wed Aug 31 17:51:54 2016 +0300
+++ b/njs/njs_string.c Wed Aug 31 19:18:47 2016 +0300
@@ -2355,7 +2355,10 @@ njs_string_decode(njs_vm_t *vm, njs_valu
byte = *src++;

if (byte == '%') {
- if (size < 3) {
+
+ size -= 2;
+
+ if (size == 0) {
goto uri_error;
}

@@ -2372,7 +2375,6 @@ njs_string_decode(njs_vm_t *vm, njs_valu
byte = (d0 << 4) + d1;

if ((reserve[byte >> 5] & ((uint32_t) 1 << (byte & 0x1f))) == 0) {
- size -= 2;
n += 2;
}
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] A fix in decodeURI() function.

Igor Sysoev 1052 August 31, 2016 12:20PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready