You've already forked ArduinoHttpClient
mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2026-10-23 10:09:02 +03:00
Fix typo in WebSocketClient::write buffer size clamp
Use sizeof(iTxBuffer) instead of sizeof(iTxSize) when computing the remaining space, preventing truncated writes and potential memcpy overflow.
This commit is contained in:
@@ -167,7 +167,7 @@ size_t WebSocketClient::write(const uint8_t *aBuffer, size_t aSize)
|
||||
// check if the write size, fits in the buffer
|
||||
if ((iTxSize + aSize) > sizeof(iTxBuffer))
|
||||
{
|
||||
aSize = sizeof(iTxSize) - iTxSize;
|
||||
aSize = sizeof(iTxBuffer) - iTxSize;
|
||||
}
|
||||
|
||||
// copy data into the buffer
|
||||
|
||||
Reference in New Issue
Block a user