mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Check for u32 overflow in String::repeated()
I don't know why this was checking for size_t overflow, but it was tripping up ASAN malloc() checks by passing a way-too-large size.
This commit is contained in:
parent
7b93b8cea7
commit
ebe6ec6069
Notes:
sideshowbarker
2024-07-16 16:23:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ebe6ec6069 Pull-request: https://github.com/SerenityOS/serenity/pull/24240 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 1 additions and 1 deletions
|
@ -310,7 +310,7 @@ bool String::equals_ignoring_ascii_case(StringView other) const
|
|||
|
||||
ErrorOr<String> String::repeated(String const& input, size_t count)
|
||||
{
|
||||
if (Checked<size_t>::multiplication_would_overflow(count, input.bytes().size()))
|
||||
if (Checked<u32>::multiplication_would_overflow(count, input.bytes().size()))
|
||||
return Error::from_errno(EOVERFLOW);
|
||||
|
||||
String result;
|
||||
|
|
Loading…
Reference in a new issue