Mårten Nordheim 9a634a5c4b QByteArray(View)::lastIndexOf: Guard against needle > haystack
Otherwise we would traverse beyond bounds.

We calculate the delta in sizes between the haystack and the needle and
if this delta is smaller than the starting position
(the `from` argument) then we start from there.

The default value for `from` is size(). With the needle being longer
than the haystack, the delta is negative and we set our starting
position to be the delta, i.e. we start before the start of the
haystack.

[ChangeLog][QtCore][QByteArray/QByteArrayView] Fixed a bug in
lastIndexOf() that could lead to out-of-bounds access when the needle
is longer than the haystack.

Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Id5cd772f00b0c3c50fbf61b4e888bba5587391ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d25e5e2cb78a2e2f2a1791fed250421ce9eefc46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-14 20:54:39 +00:00
2025-02-14 11:25:09 +00:00
2025-01-30 21:32:52 +00:00
2024-11-05 14:36:16 +01:00
2025-01-28 19:35:30 +00:00
2024-11-05 14:36:16 +01:00
2025-01-28 11:37:31 +00:00
2025-02-10 21:26:21 +00:00
2024-06-25 11:44:00 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%