diff options
author | Alexander Grishkov <gaws@mail.ru> | 2016-03-15 22:54:20 +0300 |
---|---|---|
committer | Alexander Grishkov <gaws@mail.ru> | 2016-04-08 15:09:50 +0000 |
commit | f39e542eb859f5f88c65a1b97bdf2f4256c68ec0 (patch) | |
tree | 51a3fe9109da7659281313f3800af7256883c369 /src | |
parent | 8e103902def83af0a074b81c9d527d8147def162 (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.cpp | 3 |
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; } |