summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-10 14:57:52 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-11 21:12:00 +0200
commit22bf38351954137ff17e9a314f8847ee1fd00234 (patch)
tree21b922a384fa514058323d34efec918c7ca6c3d7 /tests/auto/corelib/io
parentdfbb2d6e1db3f23c89c0b09ef32fd886b176e4b8 (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 Pick-to: 6.2 Change-Id: I5ce7bcc744c9d5426f66b8a7d0ae76c7c92f552b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-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);