sws: fix potential OOB write

Found by Codex Security

Follow-up to 0aaebf62ec

Closes #20988
This commit is contained in:
Viktor Szakats 2026-03-18 19:28:03 +01:00
parent 1c7a270e26
commit 2bb3643bc1
No known key found for this signature in database

View File

@ -1127,7 +1127,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req)
logmsg("wait for websocket traffic");
do {
got = sread(sock, reqbuf + req->offset,
sizeof(req->reqbuf) - req->offset);
sizeof(req->reqbuf) - 1 - req->offset);
if(got > 0) {
req->offset += got;
logmsg("Got %zu bytes from client", got);