Branch: refs/heads/webkitglib/2.46
Home: https://github.com/WebKit/WebKit
Commit: edcd1a11dfe3c5983963635e7083b38795344c1e
https://github.com/WebKit/WebKit/commit/edcd1a11dfe3c5983963635e7083b38795344c1e
Author: Carlos Alberto Lopez Perez <[email protected]>
Date: 2024-11-17 (Sun, 17 Nov 2024)
Changed paths:
M Source/WebCore/loader/FrameLoader.cpp
Log Message:
-----------
[WPE][Stable][2.46] Many layout tests crash on 32-bits due to an overflow
issue at FrameLoader::updateNavigationAPIEntries
https://bugs.webkit.org/show_bug.cgi?id=283136
Reviewed by Michael Catanzaro.
* This was noticed when running layout tests on ARMv7, lot of layout
tests crash. Easily reproduced for example with the layout test
imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/key-id-location-replace.html
* The crash happens when startingIndex is 0 because startingIndex is
declared as size_t (unsigned), and due to the C++ unsigned arithmetic behavior
0 - 1 is actually 4294967295 on a 32-bit platform (size_t).
However this issue is avoided on 64-bits by pure luck, because on 64-bits
this computation underflows to 18446744073709551615 which exceeds the maximum
value of int64_t (2^63 - 1 = 9223372036854775807) and this results in signed
integer overflow, causing the value to wrap into the negative range.
Specifically, the value will be interpreted as -1 because of how large unsigned
values map to signed integers when exceeding the signed type's capacity.
* Fix this issue by casting startingIndex to a signed int64_t before
substracting 1.
* This patch is not needed on main as this code is not longer there,
because it was rewrote as part of https://commits.webkit.org/283604@main
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::updateNavigationAPIEntries):
Canonical link: https://commits.webkit.org/282416.283@fix_overflow_32bits
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes