summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-09 18:34:57 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-10 14:21:58 +0200
commit62b5d88b0d62eaba2e94c0dcf1dc3d0be719ee6b (patch)
tree3d2364172a4a59a938a68bac531e8d3640e141c0 /tests/auto/corelib/io
parent9bd2ab85ac88e88f29a11a7dedc8635261ca3484 (diff)
tst_qurlinternal: Add tests for punycode overflow
Add two tests for decoding IDNs when they encode values outside Unicode (> 0x110000). "xn--5p32g" decodes to "a" (all ASCII) before QTBUG-95577 got fixed. "xn--400595c" decodes to the same value as "xn--097c" after the above mentioned bug got fixed. This test is currently failing. Task-number: QTBUG-95689 Pick-to: 6.2 Change-Id: Icab55c41e0233b34d57e38232fa90ac42f35a50a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> 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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
index 7f2c506a1a..50799f0ab4 100644
--- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
+++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
@@ -675,6 +675,17 @@ void tst_QUrlInternal::ace_testsuite_data()
QTest::newRow("invalid-nameprep-unassigned") << "xn--s5a" << "xn--s5a" << "xn--s5a" << "xn--s5a";
// same character, see QTBUG-60364
QTest::newRow("invalid-nameprep-unassigned2") << "xn--80ak6aa92e" << "xn--80ak6aa92e" << "xn--80ak6aa92e" << "xn--80ak6aa92e";
+
+ // Decodes to "a" in some versions, see QTBUG-95689
+ QTest::newRow("punycode-overflow-1") << "xn--5p32g"
+ << "xn--5p32g"
+ << "xn--5p32g"
+ << "xn--5p32g";
+ // Decodes to the same string as "xn--097c" in some versions, see QTBUG-95689
+ QTest::newRow("punycode-overflow-2") << "xn--400595c"
+ << "xn--400595c"
+ << "xn--400595c"
+ << "xn--400595c";
}
void tst_QUrlInternal::ace_testsuite()
@@ -691,6 +702,8 @@ void tst_QUrlInternal::ace_testsuite()
QString domain = in + suffix;
QCOMPARE(QString::fromLatin1(QUrl::toAce(domain)), toace + suffix);
+ QEXPECT_FAIL("punycode-overflow-2", "QTBUG-95689: Missing oweflow check in punycode decoder",
+ Abort);
if (fromace != ".")
QCOMPARE(QUrl::fromAce(domain.toLatin1()), fromace + suffix);
QCOMPARE(QUrl::fromAce(QUrl::toAce(domain)), unicode + suffix);