diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-10-27 12:03:23 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-10-27 13:36:10 (GMT) |
commit | 8135af2cebdaaccefb95f0be149328077d237a89 (patch) | |
tree | a24a3577d0c04a8f056827f2f9d8b859d691a8fc /tests/auto/qstring | |
parent | 138962d1c25a9cbb4375aa09bdeb7901c6536ce1 (diff) | |
download | Qt-8135af2cebdaaccefb95f0be149328077d237a89.zip Qt-8135af2cebdaaccefb95f0be149328077d237a89.tar.gz Qt-8135af2cebdaaccefb95f0be149328077d237a89.tar.bz2 |
Fix integer overflow in string.remove len parameter
Task: 262677
Reviewed-by: joao
Diffstat (limited to 'tests/auto/qstring')
-rw-r--r-- | tests/auto/qstring/tst_qstring.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp index 5dc1da7..2eb3152 100644 --- a/tests/auto/qstring/tst_qstring.cpp +++ b/tests/auto/qstring/tst_qstring.cpp @@ -201,6 +201,7 @@ private slots: void repeatedSignature() const; void repeated() const; void repeated_data() const; + void task262677remove(); }; typedef QList<int> IntList; @@ -4669,6 +4670,14 @@ void tst_QString::repeated_data() const << 4; } +void tst_QString::task262677remove() +{ + QString driveName = QLatin1String("V:\\blahblah\\more_blahblah\\"); + driveName.remove(2, INT_MAX); // should be "V:" - instead, it's "V::\\blahblah\\more_blahblah\\" + QVERIFY(driveName == QLatin1String("V:")); +} + + QTEST_APPLESS_MAIN(tst_QString) #include "tst_qstring.moc" |