mirror of
https://github.com/curl/curl.git
synced 2026-04-14 23:51:42 +03:00
ws: fix type conversion check
- Fix logic that checks whether a size_t will fit in a curl_off_t. Reported-by: Viktor Szakats Fixes https://github.com/curl/curl/issues/19017 Closes https://github.com/curl/curl/pull/19036
This commit is contained in:
parent
fe06127ded
commit
97ae9ec8ef
1 changed files with 2 additions and 2 deletions
4
lib/ws.c
4
lib/ws.c
|
|
@ -654,8 +654,8 @@ static curl_off_t ws_payload_remain(curl_off_t payload_total,
|
|||
curl_off_t remain = payload_total - payload_offset;
|
||||
if((payload_total < 0) || (payload_offset < 0) || (remain < 0))
|
||||
return -1;
|
||||
#if SIZEOF_OFF_T <= SIZEOF_SIZE_T
|
||||
if((curl_off_t)payload_buffered < 0)
|
||||
#if SIZEOF_SIZE_T >= SIZEOF_CURL_OFF_T
|
||||
if(payload_buffered > (size_t)CURL_OFF_T_MAX)
|
||||
return -1;
|
||||
#endif
|
||||
if(remain < (curl_off_t)payload_buffered)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue