mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:47:46 +00:00
AK: Avoid passing nullptr to __buitin_memcpy() in ByteBuffer::grow()
This commit is contained in:
parent
a4e20a87d5
commit
bfd4c7a16c
1 changed files with 2 additions and 1 deletions
|
@ -277,6 +277,7 @@ inline void ByteBufferImpl::grow(size_t size)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u8* new_data = static_cast<u8*>(kmalloc(size));
|
u8* new_data = static_cast<u8*>(kmalloc(size));
|
||||||
|
if (m_data)
|
||||||
__builtin_memcpy(new_data, m_data, m_size);
|
__builtin_memcpy(new_data, m_data, m_size);
|
||||||
u8* old_data = m_data;
|
u8* old_data = m_data;
|
||||||
m_data = new_data;
|
m_data = new_data;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue