mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-15 03:41:30 +00:00
Ensure no overrun before copying
This commit is contained in:
parent
2b0453f43e
commit
243ddf5304
@ -284,6 +284,7 @@ private:
|
||||
TIXMLASSERT( cap <= INT_MAX / 2 );
|
||||
int newAllocated = cap * 2;
|
||||
T* newMem = new T[newAllocated];
|
||||
TIXMLASSERT( newAllocated >= _size );
|
||||
memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs
|
||||
if ( _mem != _pool ) {
|
||||
delete [] _mem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user