vtls: remove int typecast for sizeof()

V220 Suspicious sequence of types castings: memsize -> 32-bit integer ->
memsize. The value being cast: 'sizeof
(buf->data)'. curl\lib\vtls\vtls.c 2025

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10928
This commit is contained in:
Kvarec Lezki 2023-04-11 16:11:50 +05:00 committed by Daniel Stenberg
parent c59b5b3c87
commit a1763648a5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2022,7 +2022,7 @@ CURLcode Curl_alpn_to_proto_str(struct alpn_proto_buf *buf,
len = strlen(spec->entries[i]);
if(len >= ALPN_NAME_MAX)
return CURLE_FAILED_INIT;
if(off + len + 2 >= (int)sizeof(buf->data))
if(off + len + 2 >= sizeof(buf->data))
return CURLE_FAILED_INIT;
if(off)
buf->data[off++] = ',';