BAN: String don't memcpy with nullptr
This commit is contained in:
parent
54a92293da
commit
a5660b95b2
|
@ -254,7 +254,8 @@ namespace BAN
|
|||
if (new_data == nullptr)
|
||||
return Error::from_errno(ENOMEM);
|
||||
|
||||
memcpy(new_data, data(), m_size + 1);
|
||||
if (m_size)
|
||||
memcpy(new_data, data(), m_size + 1);
|
||||
|
||||
if (has_sso())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue