]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: remove int typecast for sizeof()
authorKvarec Lezki <cuarzo@ya.ru>
Tue, 11 Apr 2023 11:11:50 +0000 (16:11 +0500)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 11 Apr 2023 21:48:06 +0000 (23:48 +0200)
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

lib/vtls/vtls.c

index 80168ee75fa6dac1197585f737ae2e2a05570277..521a4288f0813b398c770596ce83dec1495b82b2 100644 (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++] = ',';