mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 05:52:19 +00:00
AK: Fix out of bound access check in Span::overwrite()
Previously `data_size` (in bytes) was mistakenly compared with `size()` that returns number of elements in a span.
This commit is contained in:
parent
80a8040794
commit
005551b530
Notes:
github-actions[bot]
2025-04-24 08:32:46 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 005551b530
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4434
Reviewed-by: https://github.com/alimpfard
1 changed files with 1 additions and 1 deletions
|
@ -186,7 +186,7 @@ public:
|
|||
ALWAYS_INLINE constexpr void overwrite(size_t offset, void const* data, size_t data_size)
|
||||
{
|
||||
// make sure we're not told to write past the end
|
||||
VERIFY(offset + data_size <= size());
|
||||
VERIFY(offset + data_size <= size() * sizeof(T));
|
||||
__builtin_memmove(this->data() + offset, data, data_size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue