Core/String: Fix heap corruption
Former-commit-id: cf3f1172a43b7ddb9b8e8e9521e3dc1258fa6c21
This commit is contained in:
parent
a128c2aacb
commit
6a3eb68225
|
|
@ -4195,9 +4195,9 @@ namespace Nz
|
||||||
|
|
||||||
if (!m_sharedString.unique())
|
if (!m_sharedString.unique())
|
||||||
{
|
{
|
||||||
auto newSharedString = std::make_shared<SharedString>(GetSize());
|
auto newSharedString = std::make_shared<SharedString>(GetSize(), GetCapacity());
|
||||||
if (!discardContent)
|
if (!discardContent)
|
||||||
std::memcpy(newSharedString->string.get(), GetConstBuffer(), GetSize());
|
std::memcpy(newSharedString->string.get(), GetConstBuffer(), GetSize()+1);
|
||||||
|
|
||||||
m_sharedString = std::move(newSharedString);
|
m_sharedString = std::move(newSharedString);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue