url: fix remaining calculation
Fix remaining calculation in the PercentDecode function to match the definition in URL standard: https://url.spec.whatwg.org/#remaining PR-URL: https://github.com/nodejs/node/pull/15637 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
This commit is contained in:
parent
e0edb00762
commit
09b703bd3c
@ -518,7 +518,7 @@ static inline void PercentDecode(const char* input,
|
||||
|
||||
while (pointer < end) {
|
||||
const char ch = pointer[0];
|
||||
size_t remaining = (end - pointer) + 1;
|
||||
const size_t remaining = end - pointer - 1;
|
||||
if (ch != '%' || remaining < 2 ||
|
||||
(ch == '%' &&
|
||||
(!IsASCIIHexDigit(pointer[1]) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user