Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-05-05 14:41:35 +0300
committerGitHub <noreply@github.com>2022-05-05 14:41:35 +0300
commita3ff4bfc667c864f3729b198e6ad1b0bfaa05683 (patch)
tree97c3c96e0b8363a970a4a9d9d1646098d34d5813 /src
parentf7d658a888246f90bdd47f63b81098c0ec74bb0e (diff)
url: revert "validate ipv4 part length"
This reverts commit 87d0d7a069b2a3ca1db1dd592a62db4645ba5d69. Refs: https://github.com/nodejs/node/pull/42915 PR-URL: https://github.com/nodejs/node/pull/42940 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_url.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/node_url.cc b/src/node_url.cc
index dbb51ef5ec0..3cbe6ab5f35 100644
--- a/src/node_url.cc
+++ b/src/node_url.cc
@@ -411,11 +411,7 @@ void URLHost::ParseIPv4Host(const char* input, size_t length, bool* is_ipv4) {
const char ch = pointer < end ? pointer[0] : kEOL;
int64_t remaining = end - pointer - 1;
if (ch == '.' || ch == kEOL) {
- // If parts’s size is greater than 4, validation error, return failure.
- if (++parts > static_cast<int>(arraysize(numbers))) {
- *is_ipv4 = true;
- return;
- }
+ if (++parts > static_cast<int>(arraysize(numbers))) return;
if (pointer == mark)
return;
int64_t n = ParseNumber(mark, pointer);