-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Milestone
Description
In poco Version 1.5.0 up the resize code isn't correct:
if (newCapacity > _capacity)
{
T* ptr = new T[newCapacity];
if (preserveContent)
std::memcpy(ptr, _ptr, newCapacity); <<<<<< since newCapacity is bigger than the allocated memory it tries to access memory outside the allowed boundaries.
Calling NetworkInterface::map several times it will crash from time to time.
if (ERROR_BUFFER_OVERFLOW == (dwRetVal = GetAdaptersAddresses(family, flags, 0, pAddress, &outBufLen)))
memory.resize(outBufLen); // adjust size and try again
Don't know why not calling memory.resize(outBufLen, false); there.
Is preserving the memory necessary?
In poco 1.4.4 the resize is fine!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels