summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Grishkov <gaws@mail.ru>2016-03-15 22:54:20 +0300
committerAlexander Grishkov <gaws@mail.ru>2016-04-08 15:09:50 +0000
commitf39e542eb859f5f88c65a1b97bdf2f4256c68ec0 (patch)
tree51a3fe9109da7659281313f3800af7256883c369 /src
parent8e103902def83af0a074b81c9d527d8147def162 (diff)
Fix parsing of IPv4 addresses with certain symbols
Add some extra checks to the parser to make sure that addresses like "300-05" aren't interpreted as valid IPv4 addresses. Change-Id: I12475eebc9452e060779bb05e2b4ad9512a28281 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qipaddress.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp
index ef0ca0269e..47cbbe066a 100644
--- a/src/corelib/io/qipaddress.cpp
+++ b/src/corelib/io/qipaddress.cpp
@@ -111,6 +111,9 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL
return false;
else if (dotCount == 3 || *endptr == '\0')
return true;
+ if (*endptr != '.')
+ return false;
+
++dotCount;
ptr = endptr + 1;
}