Fix stack overflow in remotePutPacket
If the packet passed into remotePutPacket was 1024 bytes or larger then the buffer array would not be large enough to hold the $, checksum and zero byte written. This now allocates a buffer of size count + 5 to accommodate these extra characters.
This commit is contained in:
parent
db8aaeca87
commit
4f28e84632
|
@ -3526,9 +3526,9 @@ void remoteInit()
|
|||
void remotePutPacket(const char* packet)
|
||||
{
|
||||
const char* hex = "0123456789abcdef";
|
||||
char buffer[1024];
|
||||
|
||||
size_t count = strlen(packet);
|
||||
char buffer[count + 5];
|
||||
|
||||
unsigned char csum = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue