qt5base-lts/tests/auto/corelib/tools
Giuseppe D'Angelo b9f96cacc9 QRegExp: remove an out of bounds access into QString
... spotted with the brand-new checks for that in QCharRef.

The rx[i] == ~~~ check is clearly wrong, as rx is the regexp
we're building and `i` was not supposed to index into it.

The intended meaning was wc[i] == ~~~, testing if we were seeing
the closing bracket of a character set. We need to check for
that immediately for dealing with the special syntax of []...] where
the ] belongs to the character set (it can't be the closing one
as character sets cannot be empty).

Fix and add a regression test. Bonus: this code was almost
unchanged since 2009.

Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 17:33:30 +00:00
..
collections implement non-member operator+ for iterators 2018-03-06 22:04:37 +00:00
containerapisymmetry Add front()/back() to QString, QStringRef, QByteArray and QLatin1String 2017-04-07 08:32:32 +00:00
qalgorithms Change almost all other uses of qrand() to QRandomGenerator 2017-11-08 09:14:03 +00:00
qarraydata tst_QArrayData: fix unused variable warning in reallocate() 2017-03-22 09:22:34 +00:00
qarraydata_strictiterators
qbitarray Updated license headers 2016-01-21 18:55:18 +00:00
qbytearray QByteArray: toInt() and toDouble() ignore surrounding whitespaces 2018-07-07 19:58:18 +00:00
qbytearraylist Updated license headers 2016-01-21 18:55:18 +00:00
qbytearraymatcher Long live QStaticByteArrayMatcher! 2017-01-19 21:37:46 +00:00
qbytedatabuffer Updated license headers 2016-01-21 18:55:18 +00:00
qcache Updated license headers 2016-01-21 18:55:18 +00:00
qchar Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
qcollator Handle QCollator with locale C by delegating to QString 2018-12-11 19:05:07 +00:00
qcommandlineparser Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qcontiguouscache Updated license headers 2016-01-21 18:55:18 +00:00
qcryptographichash QCryptographicHash: Add a static method to retrieve hash length 2018-04-10 12:17:43 +00:00
qdate Raise the upper bound on years to 9999 2017-11-30 20:19:13 +00:00
qdatetime Avoid read-outside-array error by QStringRef over-reach 2019-02-08 13:56:25 +00:00
qeasingcurve MinGW: Exclude failing value of tst_QEasingCurve::setCustomType() 2018-08-21 07:12:19 +00:00
qexplicitlyshareddatapointer Add nullptr comparison to Q{Explicitly,}SharedDataPointer 2018-03-18 17:28:26 +00:00
qfreelist Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qhash Merge remote-tracking branch 'origin/5.9' into dev 2017-05-07 13:08:18 +02:00
qhash_strictiterators
qhashfunctions QHash: make it so a zero seed selects a constant algorithm 2017-04-26 15:22:44 +00:00
qlatin1string Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qline Tests: Fix clang warnings about unused variables and captures 2018-05-02 09:36:00 +00:00
qlinkedlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qlist_strictiterators
qlocale Update locale data to CLDR v35.1 2019-05-07 09:29:51 +00:00
qmacautoreleasepool Add missing dependencies for tst_qmacautoreleasepool 2018-08-29 02:47:45 +00:00
qmakearray corelib/tools: add qMakeArray() API 2018-07-25 06:57:44 +00:00
qmap Implement key-value iterator 2017-05-05 14:25:56 +00:00
qmap_strictiterators
qmargins Updated license headers 2016-01-21 18:55:18 +00:00
qmessageauthenticationcode Updated license headers 2016-01-21 18:55:18 +00:00
qpair Merge remote-tracking branch 'origin/5.6' into 5.7 2016-07-15 20:47:57 +02:00
qpoint Updated license headers 2016-01-21 18:55:18 +00:00
qpointf Fix regression in QPointF::operator== 2018-07-09 15:38:31 +00:00
qqueue Updated license headers 2016-01-21 18:55:18 +00:00
qrect Improve rounding of QRect::toRect 2017-06-26 21:35:38 +00:00
qregexp QRegExp: remove an out of bounds access into QString 2019-05-27 17:33:30 +00:00
qregularexpression QRegularExpression: anchor wildcard pattern 2018-12-15 13:24:16 +00:00
qringbuffer QRingBuffer: avoid reallocations of the data 2017-12-30 10:15:10 +00:00
qscopedpointer QScopedPointer: add get() 2017-09-17 11:42:26 +00:00
qscopedvaluerollback Updated license headers 2016-01-21 18:55:18 +00:00
qscopeguard Introduce QScopeGuard 2018-07-21 17:47:35 +00:00
qset Updated license headers 2016-01-21 18:55:18 +00:00
qsharedpointer Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qsize Updated license headers 2016-01-21 18:55:18 +00:00
qsizef Updated license headers 2016-01-21 18:55:18 +00:00
qstl Updated license headers 2016-01-21 18:55:18 +00:00
qstring Use RAII to handle setting of default locale in tst_QString 2019-01-22 16:42:29 +00:00
qstring_no_cast_from_bytearray Updated license headers 2016-01-21 18:55:18 +00:00
qstringapisymmetry qstringapisymmetry: Fix XML parsing failing on invalid encodings 2018-03-02 07:59:12 +00:00
qstringbuilder QStringBuilder: add support for QStringView 2018-01-08 09:41:43 +00:00
qstringiterator QStringIterator: port to QStringView 2017-04-03 15:41:09 +00:00
qstringlist QStringList: add contains(QStringView) overload 2018-09-03 08:55:52 +00:00
qstringmatcher QStringMatcher: fix setCaseSensitivity() on a non-QString-backed matcher 2017-02-07 16:31:00 +00:00
qstringref Remove references to obsolete platforms 2017-11-05 06:33:53 +00:00
qstringview QStringView: Add compare() member function 2018-07-13 13:32:34 +00:00
qtextboundaryfinder Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
qtime Raise the upper bound on years to 9999 2017-11-30 20:19:13 +00:00
qtimeline Extend blacklisting of qtimeline::frameRate to macOS 10.13 2018-09-24 21:13:00 +00:00
qtimezone Fix various uncommon cases in QTzTimeZonePrivate backend 2019-04-05 20:31:26 +00:00
qvarlengtharray fixup oversight in rvalue overloads of operator+=() and operator<<() 2018-03-26 14:29:47 +00:00
qvector fixup oversight in rvalue overloads of operator+=() and operator<<() 2018-03-26 14:29:47 +00:00
qvector_strictiterators
qversionnumber Tests: Raise minimum supported MSVC version to 2015 2018-01-04 20:23:25 +00:00
tools.pro corelib/tools: add qMakeArray() API 2018-07-25 06:57:44 +00:00