summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-10-15 12:37:33 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-10-26 17:38:22 +0200
commitbb220f2d99261eaa7c5021988a9443735ed2a93d (patch)
treedc6d38ec5eaaa7178e73db52570d90347bb05884 /tests
parent25e85ec45fe5ca00c90fab4ab764f46117fbcb24 (diff)
Fix overflow issue on parsing min-qint64 with its minus sign repeated
The call to std::from_chars() accepts a sign, but we've already dealt with a sign, so that would be a second sign. Check the first character after any prefix is in fact a digit (for the base in use). This is a follow-up to commit 5644af6f8a800a1516360a42ba4c1a8dc61fc516. Fixes: QTBUG-97521 Change-Id: I65fb144bf6a8430da90ec5f65088ca20e79bf02f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
index 543449c5e6..a64811cea4 100644
--- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
+++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
@@ -2080,6 +2080,7 @@ void tst_QStringApiSymmetry::toNumber_data()
QTest::addRow("-32768") << QString::fromUtf8("-32768") << qint64(-32768) << true;
QTest::addRow("100x") << QString::fromUtf8("100x") << qint64(0) << false;
QTest::addRow("-100x") << QString::fromUtf8("-100x") << qint64(0) << false;
+ QTest::addRow("-min64") << QString::fromUtf8("--9223372036854775808") << qint64(0) << false;
}
template<typename T>