1
0
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:
pennam
2026-07-13 12:34:35 +02:00
parent d3de6c8bfe
commit af935ce9df

View File

@@ -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