diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-05-08 13:31:12 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 02:39:30 +0200 |
commit | 75552c8f62dcfb8012c306b37c79ec629448d780 (patch) | |
tree | a2568f71173982feb3e34250f1a3d9fc25dbd034 /tests/auto | |
parent | ff3a2ab24259d623aeb15d596a1c3be5f683579d (diff) |
Fix a crash when parsing a URL with username and port, but no password
This was crashing because the ':' was found past the end of the
username, causing the recoder to run from position 22 to 11, via the
long way around the memory.
Change-Id: Ic1ae596f34f7db857fb4210294974fb5a6adf691
Reviewed-by: Alexis Menard <alexis.menard@openbossa.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/io/qurl/tst_qurl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 46d491ba79..63f9cd06dc 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -411,6 +411,16 @@ void tst_QUrl::setUrl() } { + QUrl url("http://user@localhost:8000/xmlhttprequest/resources/basic-auth-nouserpass/basic-auth-nouserpass.php"); + QVERIFY(url.isValid()); + QCOMPARE(url.scheme(), QString::fromLatin1("http")); + QCOMPARE(url.userName(), QString::fromLatin1("user")); + QCOMPARE(url.password(), QString()); + QCOMPARE(url.userInfo(), QString::fromLatin1("user")); + QCOMPARE(url.port(), 8000); + } + + { QUrl url("http://www.foo.bar"); QVERIFY(url.isValid()); |