diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index f3b299e586..89314f8eb8 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -74,7 +74,8 @@ public: [[nodiscard]] static ByteBuffer copy(void const* data, size_t size) { auto buffer = create_uninitialized(size); - __builtin_memcpy(buffer.data(), data, size); + if (size != 0) + __builtin_memcpy(buffer.data(), data, size); return buffer; }