mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
fix nullptr passed to memcmp/memcpy reported by ubsan
This commit is contained in:
parent
230812093b
commit
2f33db9053
@ -191,7 +191,7 @@ public:
|
||||
if (newCapacity > 0)
|
||||
{
|
||||
ptr = new T[newCapacity];
|
||||
if (preserveContent)
|
||||
if (preserveContent && _ptr)
|
||||
{
|
||||
std::size_t newSz = _used < newCapacity ? _used : newCapacity;
|
||||
std::memcpy(ptr, _ptr, newSz * sizeof(T));
|
||||
|
Loading…
Reference in New Issue
Block a user