summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-01-08 14:34:46 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-14 20:45:48 (GMT)
commita17fc85b51a6bdcfa33dcff183d2b7efd667fb92 (patch)
tree099e837b8fd6375f2be2f2fa49db77078116fb72 /src/corelib
parent6db96677ab9e1b3d717e3704a658e528b457b255 (diff)
downloadQt-a17fc85b51a6bdcfa33dcff183d2b7efd667fb92.zip
Qt-a17fc85b51a6bdcfa33dcff183d2b7efd667fb92.tar.gz
Qt-a17fc85b51a6bdcfa33dcff183d2b7efd667fb92.tar.bz2
Limit the range of the QUrlPrivate::port to -1 to 65535
The internal parser can read values outside this range (and cannot report an error), but QUrl::port() must not return something outside that range. The correct solution would be to report an error, like in Qt 5, but that cannot easily be done. The rewritten parser in Qt 5 is not affected by this issue. Task-number: QTBUG-28985 Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0 Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qurl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 551a990..cf84eb5 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3920,7 +3920,7 @@ void QUrlPrivate::parse(ParseOptions parseOptions) const
QByteArray h(parseData.host, parseData.hostLength);
that->host = fromPercentEncodingMutable(&h);
- that->port = parseData.port;
+ that->port = uint(parseData.port) <= 0xffffU ? parseData.port : -1;
that->path.clear();
that->encodedPath = QByteArray(parseData.path, parseData.pathLength);