mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
AK: Don't call memcpy with null argument in ByteBuffer::copy()
This was happening in TestBase64.test_decode, while copying an empty string.
This commit is contained in:
parent
00fa5dc53e
commit
11214bc94d
Notes:
sideshowbarker
2024-07-18 17:59:56 +09:00
Author: https://github.com/ADKaster
Commit: 11214bc94d
Pull-request: https://github.com/SerenityOS/serenity/pull/7157
Issue: https://github.com/SerenityOS/serenity/issues/7073
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/metmo
1 changed files with 2 additions and 1 deletions
|
@ -74,6 +74,7 @@ public:
|
|||
[[nodiscard]] static ByteBuffer copy(void const* data, size_t size)
|
||||
{
|
||||
auto buffer = create_uninitialized(size);
|
||||
if (size != 0)
|
||||
__builtin_memcpy(buffer.data(), data, size);
|
||||
return buffer;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue