Skip to content

Commit 1cc4245

Browse files
rmisevMylesBorins
authored andcommittedOct 11, 2017
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: #15637 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
1 parent 7e1003a commit 1cc4245

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/node_url.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static inline void PercentDecode(const char* input,
518518

519519
while (pointer < end) {
520520
const char ch = pointer[0];
521-
size_t remaining = (end - pointer) + 1;
521+
const size_t remaining = end - pointer - 1;
522522
if (ch != '%' || remaining < 2 ||
523523
(ch == '%' &&
524524
(!IsASCIIHexDigit(pointer[1]) ||

0 commit comments

Comments
 (0)
Please sign in to comment.