Changed strcpy to memmove to handle memory overlaps

This commit is contained in:
anschrammh 2019-11-17 10:59:59 +01:00
parent c19c15dd07
commit cd46e089f1

View File

@ -77,6 +77,6 @@ void TCPClient::freeDataBuffer(uint16_t size)
#endif #endif
} }
strcpy((char *)_data, (char *)_data + secureSize); memmove(_data, _data + secureSize, _dataSize - secureSize + 1 /*We do not forget to copy the \0 at then end*/);
_dataSize -= secureSize; _dataSize -= secureSize;
} }