summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-10 14:57:52 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-12 00:22:51 +0000
commita868aa866324f0d3b8489b6b9acd164bf446f797 (patch)
tree49833e86b7c4bb752b68d5099ae2a31571bc34ef /tests
parentdb90bcffc30b61789c4576a863b117e8223e631a (diff)
tst_qurlinternal: Add another Punycode overflow test
The test string "xn--l0902716a" encodes 2**32. Currently the IDNA code returns an empty string when encoding this to Unicode instead of expected original string. Task-number: QTBUG-95689 Change-Id: I5ce7bcc744c9d5426f66b8a7d0ae76c7c92f552b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 22bf38351954137ff17e9a314f8847ee1fd00234) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
index 1b4f6462b2..6a55295f4b 100644
--- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
+++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
@@ -684,6 +684,9 @@ void tst_QUrlInternal::ace_testsuite_data()
badRow("punycode-overflow-1", "xn--5p32g");
// Decodes to the same string as "xn--097c" in some versions, see QTBUG-95689
badRow("punycode-overflow-2", "xn--400595c");
+
+ // Encodes 2**32, decodes to empty string in some versions
+ badRow("punycode-overflow-3", "xn--l0902716a");
}
void tst_QUrlInternal::ace_testsuite()
@@ -702,6 +705,7 @@ void tst_QUrlInternal::ace_testsuite()
QCOMPARE(QString::fromLatin1(QUrl::toAce(domain)), toace + suffix);
QEXPECT_FAIL("punycode-overflow-2", "QTBUG-95689: Missing oweflow check in punycode decoder",
Abort);
+ QEXPECT_FAIL("punycode-overflow-3", "QTBUG-95689: Returns empty string", Abort);
if (fromace != ".")
QCOMPARE(QUrl::fromAce(domain.toLatin1()), fromace + suffix);
QCOMPARE(QUrl::fromAce(QUrl::toAce(domain)), unicode + suffix);