qt6-bb10/tests/auto/corelib
Edward Welbourne c066656aff Avoid read-outside-array error by QStringRef over-reach
Constructing a QStringRef directly from the string, offset and a
length is UB if the offset + length exceeds the string's length.
Thanks to Robert Loehning and libFuzzer for finding this.
QString::midRef (as correctly used in both changed uses of QStringRef,
since 432d3b6962) takes care of that for us.  Changed one UB case and
a matching but correct case, for consistency.

In the process, deduplicate a QStringList look-up.
Added tests to exercise the code (but the one that exercises the
formerly UB case doesn't crash before the fix, so isn't very useful;
the invalid read is only outside the array it's scanning, not outside
allocated memory).

Change-Id: I7051bbbc0267dd7ec0a8f75eee2034d0b7eb75a2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-08 13:56:25 +00:00
..
animation Extend blacklisting of tst_qparallelanimationgroup tests to macOS 10.13 2018-09-24 21:13:30 +00:00
codecs Add tests for decoding too-short UTF-8 sequences 2018-09-25 22:14:07 +00:00
global Merge remote-tracking branch 'origin/5.11' into 5.12 2018-11-27 01:00:09 +01:00
io Use a more robust test for absolute paths in QDir 2019-01-13 18:18:10 +00:00
itemmodels Fix QStringListModel::setData to check for actual changes 2018-12-24 08:07:36 +00:00
kernel Blacklist qtimer/basic_chrono on macos due to flakiness 2019-01-30 10:10:19 +00:00
mimetypes QMimeType: Use default key as fallback for comment() property 2018-11-02 08:27:10 +00:00
plugin Avoid invalid qmake code in macOS-specific pluginloader test 2018-11-30 14:47:29 +00:00
serialization Merge remote-tracking branch 'origin/5.11' into 5.12 2018-11-27 01:00:09 +01:00
statemachine tst_QStateMachine: Don't use unconditional waits 2018-04-04 07:07:40 +00:00
thread Expand blacklisting of qthreadpool to cover linux distros 2019-01-30 10:10:17 +00:00
tools Avoid read-outside-array error by QStringRef over-reach 2019-02-08 13:56:25 +00:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00