diff --git a/src/node_url.cc b/src/node_url.cc index 04254667d6d824..be4276c844c8d9 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -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]) ||