From: Kvarec Lezki Date: Tue, 11 Apr 2023 11:11:50 +0000 (+0500) Subject: vtls: remove int typecast for sizeof() X-Git-Tag: curl-8_1_0~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1763648a5825f571afb7b1602450eb6a97908a0;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 80168ee75f..521a4288f0 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -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++] = ',';