[ 1123124 ] wxStringBase::Alloc can change string length
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
518ba66331
commit
83efadb7f3
@ -380,7 +380,9 @@ bool wxStringBase::Alloc(size_t nLen)
|
|||||||
// allocation failure handled by caller
|
// allocation failure handled by caller
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
memcpy(m_pchData, pData->data(), nOldLen*sizeof(wxChar));
|
// +1 to copy the terminator, too
|
||||||
|
memcpy(m_pchData, pData->data(), (nOldLen+1)*sizeof(wxChar));
|
||||||
|
GetStringData()->nDataLength = nOldLen;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nLen += EXTRA_ALLOC;
|
nLen += EXTRA_ALLOC;
|
||||||
|
Loading…
Reference in New Issue
Block a user