mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
sws: fix potential OOB write
Found by Codex Security
Follow-up to 0aaebf62ec
Closes #20988
This commit is contained in:
parent
1c7a270e26
commit
2bb3643bc1
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user