summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qipaddress.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp
index 02b12f635a..039e291b43 100644
--- a/src/corelib/io/qipaddress.cpp
+++ b/src/corelib/io/qipaddress.cpp
@@ -216,7 +216,10 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
quint64 ll = qstrtoull(ptr, &endptr, 16, &ok);
quint16 x = ll;
- if (!ok || ll != x)
+ // Reject malformed fields:
+ // - failed to parse
+ // - too many hex digits
+ if (!ok || endptr > ptr + 4)
return begin + (ptr - buffer.data());
if (*endptr == '.') {