From cd46e089f131c43fbc9dd2ea567bd7b7809f99a0 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Sun, 17 Nov 2019 10:59:59 +0100 Subject: [PATCH] Changed strcpy to memmove to handle memory overlaps --- src/app/TCPClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/TCPClient.cpp b/src/app/TCPClient.cpp index 71fde85..0cd33ba 100644 --- a/src/app/TCPClient.cpp +++ b/src/app/TCPClient.cpp @@ -77,6 +77,6 @@ void TCPClient::freeDataBuffer(uint16_t size) #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; }