From ebe6ec60697bbde222a17848ccdf5af9789cc421 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 May 2024 21:52:11 +0200 Subject: [PATCH] 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. --- AK/String.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/String.cpp b/AK/String.cpp index 2b63f042926..acd794006d8 100644 --- a/AK/String.cpp +++ b/AK/String.cpp @@ -310,7 +310,7 @@ bool String::equals_ignoring_ascii_case(StringView other) const ErrorOr String::repeated(String const& input, size_t count) { - if (Checked::multiplication_would_overflow(count, input.bytes().size())) + if (Checked::multiplication_would_overflow(count, input.bytes().size())) return Error::from_errno(EOVERFLOW); String result;