Task #132134 - fixed.err
back to task #132134download
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/apps/lib/apps.c: scope_hint: In function 'app_get_pass'
openssl-3.5.5/apps/lib/apps.c:266:17: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 266 | tmp = strchr(arg, ':');
# | ^
# 264| } else {
# 265| /* argument syntax error; do not reveal too much about arg */
# 266|-> tmp = strchr(arg, ':');
# 267| if (tmp == NULL || tmp - arg > PASS_SOURCE_SIZE_MAX)
# 268| BIO_printf(bio_err,
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/apps/lib/apps.c:266:17: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 264| } else {
# 265| /* argument syntax error; do not reveal too much about arg */
# 266|-> tmp = strchr(arg, ':');
# 267| if (tmp == NULL || tmp - arg > PASS_SOURCE_SIZE_MAX)
# 268| BIO_printf(bio_err,
Error: GCC_ANALYZER_WARNING (CWE-476):
openssl-3.5.5/crypto/bio/bss_fd.c:219:5: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ptr'
openssl-3.5.5/crypto/bio/bss_fd.c:208:12: enter_function: entry to 'fd_gets'
openssl-3.5.5/crypto/bio/bss_fd.c:214:12: branch_true: following 'true' branch (when 'ptr < end')...
openssl-3.5.5/crypto/bio/bss_fd.c:214:25: call_function: inlined call to 'fd_read' from 'fd_gets'
openssl-3.5.5/crypto/bio/bss_fd.c:219:5: danger: dereference of NULL 'ptr'
# 217| }
# 218|
# 219|-> ptr[0] = '\0';
# 220|
# 221| if (buf[0] != '\0')
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/conf/conf_mod.c: scope_hint: In function 'module_find'
openssl-3.5.5/crypto/conf/conf_mod.c:401:7: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 401 | p = strrchr(name, '.');
# | ^
# 399| STACK_OF(CONF_MODULE) *mods;
# 400|
# 401|-> p = strrchr(name, '.');
# 402|
# 403| if (p)
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/conf/conf_mod.c:401:7: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 399| STACK_OF(CONF_MODULE) *mods;
# 400|
# 401|-> p = strrchr(name, '.');
# 402|
# 403| if (p)
Error: COMPILER_WARNING:
openssl-3.5.5/crypto/context.c:10:9: warning: '_GNU_SOURCE' redefined
# 10 | #define _GNU_SOURCE /* needed for secure_getenv */
# | ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition
# 8| */
# 9|
# 10|-> #define _GNU_SOURCE /* needed for secure_getenv */
# 11| #include "crypto/cryptlib.h"
# 12| #include <openssl/conf.h>
Error: COMPILER_WARNING:
openssl-3.5.5/crypto/context.c:10:9: warning[warning]: '_GNU_SOURCE' redefined
# 8| */
# 9|
# 10|-> #define _GNU_SOURCE /* needed for secure_getenv */
# 11| #include "crypto/cryptlib.h"
# 12| #include <openssl/conf.h>
Error: COMPILER_WARNING (CWE-1164):
openssl-3.5.5/crypto/context.c:33:13: warning[-Wunused-function]: 'read_kernel_fips_flag' defined but not used
# 33 | static void read_kernel_fips_flag(void)
# | ^~~~~~~~~~~~~~~~~~~~~
# 31| static int kernel_fips_flag;
# 32|
# 33|-> static void read_kernel_fips_flag(void)
# 34| {
# 35| char buf[2] = "0";
Error: GCC_ANALYZER_WARNING (CWE-688):
openssl-3.5.5/crypto/engine/eng_ctrl.c:37:44: warning[-Wanalyzer-null-argument]: use of NULL 's' where non-null expected
openssl-3.5.5/crypto/engine/eng_ctrl.c:222:5: enter_function: entry to 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:229:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: call_function: calling 'ENGINE_cmd_is_executable' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_cmd_is_executable'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:269:8: branch_true: following 'true' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_true: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_false: following 'false' branch (when 'arg' is NULL)...
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
# 35| {
# 36| int idx = 0;
# 37|-> while (!int_ctrl_cmd_is_null(defn) && (strcmp(defn->cmd_name, s) != 0)) {
# 38| idx++;
# 39| defn++;
Error: GCC_ANALYZER_WARNING (CWE-688):
openssl-3.5.5/crypto/engine/eng_ctrl.c:111:23: warning[-Wanalyzer-null-argument]: use of NULL 'p' where non-null expected
openssl-3.5.5/crypto/engine/eng_ctrl.c:222:5: enter_function: entry to 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:229:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: call_function: calling 'ENGINE_cmd_is_executable' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_cmd_is_executable'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:269:8: branch_true: following 'true' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_true: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_false: following 'false' branch (when 'arg' is NULL)...
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
# 109| return strlen(cdp->cmd_name);
# 110| case ENGINE_CTRL_GET_NAME_FROM_CMD:
# 111|-> return strlen(strcpy(s, cdp->cmd_name));
# 112| case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
# 113| return strlen(cdp->cmd_desc == NULL ? int_no_description
Error: GCC_ANALYZER_WARNING (CWE-688):
openssl-3.5.5/crypto/engine/eng_ctrl.c:116:23: warning[-Wanalyzer-null-argument]: use of NULL 'p' where non-null expected
openssl-3.5.5/crypto/engine/eng_ctrl.c:222:5: enter_function: entry to 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:229:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:234:19: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:233:9: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: call_function: calling 'ENGINE_cmd_is_executable' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:10: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_cmd_is_executable'
openssl-3.5.5/crypto/engine/eng_ctrl.c:252:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
openssl-3.5.5/crypto/engine/eng_ctrl.c:257:13: return_function: returning to 'ENGINE_ctrl_cmd_string' from 'ENGINE_ctrl'
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: following 'false' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:258:8: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:269:8: branch_true: following 'true' branch...
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_true: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:270:12: branch_false: following 'false' branch (when 'arg' is NULL)...
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: branch_false: ...to here
openssl-3.5.5/crypto/engine/eng_ctrl.c:280:13: call_function: calling 'ENGINE_ctrl' from 'ENGINE_ctrl_cmd_string'
# 114| : cdp->cmd_desc);
# 115| case ENGINE_CTRL_GET_DESC_FROM_CMD:
# 116|-> return strlen(strcpy(s, cdp->cmd_desc == NULL ? int_no_description : cdp->cmd_desc));
# 117| case ENGINE_CTRL_GET_CMD_FLAGS:
# 118| return cdp->cmd_flags;
Error: GCC_ANALYZER_WARNING (CWE-835):
openssl-3.5.5/crypto/evp/bio_ok.c:360:16: warning[-Wanalyzer-infinite-loop]: infinite loop
openssl-3.5.5/crypto/evp/bio_ok.c:360:16: danger: infinite loop here
openssl-3.5.5/crypto/evp/bio_ok.c:360:16: branch_true: if it ever follows 'true' branch, it will always do so...
openssl-3.5.5/crypto/evp/bio_ok.c:360:16: branch_true: ...to here
# 358| return 0;
# 359|
# 360|-> while (ctx->blockout) {
# 361| i = ok_write(b, NULL, 0);
# 362| if (i < 0) {
Error: CPPCHECK_WARNING (CWE-457):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:181: error[legacyUninitvar]: Uninitialized variable: blocks[0].c
# 179|
# 180| /* ask for IVs in bulk */
# 181|-> if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0)
# 182| return 0;
# 183|
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:205:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:769:12: enter_function: entry to 'aesni_cbc_hmac_sha1_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:887:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha1_ctrl'
# 203|
# 204| for (i = 1; i < x4; i++) {
# 205|-> ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 206| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 207| memcpy(ciph_d[i].out - 16, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:205:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:769:12: enter_function: entry to 'aesni_cbc_hmac_sha1_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:887:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha1_ctrl'
# 203|
# 204| for (i = 1; i < x4; i++) {
# 205|-> ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 206| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 207| memcpy(ciph_d[i].out - 16, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:206:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:769:12: enter_function: entry to 'aesni_cbc_hmac_sha1_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:887:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha1_ctrl'
# 204| for (i = 1; i < x4; i++) {
# 205| ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 206|-> ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 207| memcpy(ciph_d[i].out - 16, IVs, 16);
# 208| memcpy(ciph_d[i].iv, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:208:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:769:12: enter_function: entry to 'aesni_cbc_hmac_sha1_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:887:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha1_ctrl'
# 206| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 207| memcpy(ciph_d[i].out - 16, IVs, 16);
# 208|-> memcpy(ciph_d[i].iv, IVs, 16);
# 209| IVs += 16;
# 210| }
Error: CPPCHECK_WARNING (CWE-758):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:707: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 705| for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) {
# 706| c = p[j];
# 707|-> cmask = ((int)(j - off - SHA_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
# 708| res |= (c ^ pad) & ~cmask; /* ... and padding */
# 709| cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
Error: CPPCHECK_WARNING (CWE-758):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha1.c:709: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 707| cmask = ((int)(j - off - SHA_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
# 708| res |= (c ^ pad) & ~cmask; /* ... and padding */
# 709|-> cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
# 710| res |= (c ^ pmac->c[i]) & cmask;
# 711| i += 1 & cmask;
Error: CPPCHECK_WARNING (CWE-457):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:175: error[legacyUninitvar]: Uninitialized variable: blocks[0].c
# 173|
# 174| /* ask for IVs in bulk */
# 175|-> if (RAND_bytes((IVs = blocks[0].c), 16 * x4) <= 0)
# 176| return 0;
# 177|
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:200:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:738:12: enter_function: entry to 'aesni_cbc_hmac_sha256_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:863:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha256_ctrl'
# 198|
# 199| for (i = 1; i < x4; i++) {
# 200|-> ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 201| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 202| memcpy(ciph_d[i].out - 16, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:200:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:738:12: enter_function: entry to 'aesni_cbc_hmac_sha256_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:863:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha256_ctrl'
# 198|
# 199| for (i = 1; i < x4; i++) {
# 200|-> ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 201| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 202| memcpy(ciph_d[i].out - 16, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:201:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:738:12: enter_function: entry to 'aesni_cbc_hmac_sha256_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:863:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha256_ctrl'
# 199| for (i = 1; i < x4; i++) {
# 200| ciph_d[i].inp = hash_d[i].ptr = hash_d[i - 1].ptr + frag;
# 201|-> ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 202| memcpy(ciph_d[i].out - 16, IVs, 16);
# 203| memcpy(ciph_d[i].iv, IVs, 16);
Error: GCC_ANALYZER_WARNING (CWE-121):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:203:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:738:12: enter_function: entry to 'aesni_cbc_hmac_sha256_ctrl'
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:863:21: call_function: calling 'tls1_1_multi_block_encrypt' from 'aesni_cbc_hmac_sha256_ctrl'
# 201| ciph_d[i].out = ciph_d[i - 1].out + packlen;
# 202| memcpy(ciph_d[i].out - 16, IVs, 16);
# 203|-> memcpy(ciph_d[i].iv, IVs, 16);
# 204| IVs += 16;
# 205| }
Error: CPPCHECK_WARNING (CWE-758):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:704: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 702| j++) {
# 703| c = p[j];
# 704|-> cmask = ((int)(j - off - SHA256_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
# 705| res |= (c ^ pad) & ~cmask; /* ... and padding */
# 706| cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
Error: CPPCHECK_WARNING (CWE-758):
openssl-3.5.5/crypto/evp/e_aes_cbc_hmac_sha256.c:706: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 704| cmask = ((int)(j - off - SHA256_DIGEST_LENGTH)) >> (sizeof(int) * 8 - 1);
# 705| res |= (c ^ pad) & ~cmask; /* ... and padding */
# 706|-> cmask &= ((int)(off - 1 - j)) >> (sizeof(int) * 8 - 1);
# 707| res |= (c ^ pmac->c[i]) & cmask;
# 708| i += 1 & cmask;
Error: CPPCHECK_WARNING (CWE-190):
openssl-3.5.5/crypto/evp/evp_enc.c:31: error[integerOverflow]: Signed integer underflow for expression '(~((int)1<<(sizeof(int)*8-1)))-b'.
# 29| #include "evp_local.h"
# 30|
# 31|-> OSSL_SAFE_MATH_SIGNED(int, int)
# 32|
# 33| int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/punycode.c: scope_hint: In function 'ossl_a2ulabel'
openssl-3.5.5/crypto/punycode.c:271:24: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
# 271 | char *tmpptr = strchr(inptr, '.');
# | ^~~~~~
# 269|
# 270| while (1) {
# 271|-> char *tmpptr = strchr(inptr, '.');
# 272| size_t delta = tmpptr != NULL ? (size_t)(tmpptr - inptr) : strlen(inptr);
# 273|
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/punycode.c:271:24: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
# 269|
# 270| while (1) {
# 271|-> char *tmpptr = strchr(inptr, '.');
# 272| size_t delta = tmpptr != NULL ? (size_t)(tmpptr - inptr) : strlen(inptr);
# 273|
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_cpols.c: scope_hint: In function 'displaytext_get_tag_len'
openssl-3.5.5/crypto/x509/v3_cpols.c:259:19: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
# 259 | char *colon = strchr(tagstr, ':');
# | ^~~~~~
# 257| static int displaytext_get_tag_len(const char *tagstr)
# 258| {
# 259|-> char *colon = strchr(tagstr, ':');
# 260|
# 261| return (colon == NULL) ? -1 : colon - tagstr;
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_cpols.c:259:19: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
# 257| static int displaytext_get_tag_len(const char *tagstr)
# 258| {
# 259|-> char *colon = strchr(tagstr, ':');
# 260|
# 261| return (colon == NULL) ? -1 : colon - tagstr;
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_san.c: scope_hint: In function 'do_othername'
openssl-3.5.5/crypto/x509/v3_san.c:636:12: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 636 | if ((p = strchr(value, ';')) == NULL)
# | ^
# 634| int objlen;
# 635|
# 636|-> if ((p = strchr(value, ';')) == NULL)
# 637| return 0;
# 638| if ((gen->d.otherName = OTHERNAME_new()) == NULL)
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_san.c:636:12: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 634| int objlen;
# 635|
# 636|-> if ((p = strchr(value, ';')) == NULL)
# 637| return 0;
# 638| if ((gen->d.otherName = OTHERNAME_new()) == NULL)
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_utl.c: scope_hint: In function 'a2i_IPADDRESS_NC'
openssl-3.5.5/crypto/x509/v3_utl.c:1125:7: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 1125 | p = strchr(ipasc, '/');
# | ^
# 1123| int iplen1, iplen2;
# 1124|
# 1125|-> p = strchr(ipasc, '/');
# 1126| if (p == NULL)
# 1127| return NULL;
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/crypto/x509/v3_utl.c:1125:7: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 1123| int iplen1, iplen2;
# 1124|
# 1125|-> p = strchr(ipasc, '/');
# 1126| if (p == NULL)
# 1127| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-476):
openssl-3.5.5/include/internal/ktls.h:430:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cmsg'
openssl-3.5.5/include/internal/ktls.h:410:8: branch_false: following 'false' branch (when 'length > 20')...
openssl-3.5.5/include/internal/ktls.h:415:5: branch_false: ...to here
openssl-3.5.5/include/internal/ktls.h:425:8: branch_false: following 'false' branch (when 'ret >= 0')...
openssl-3.5.5/include/internal/ktls.h:428:9: branch_false: ...to here
openssl-3.5.5/include/internal/ktls.h:428:8: branch_true: following 'true' branch...
openssl-3.5.5/include/internal/ktls.h:429:16: branch_true: ...to here
openssl-3.5.5/include/internal/ktls.h:429:16: branch_false: following 'false' branch...
openssl-3.5.5/include/internal/ktls.h:430:13: branch_false: ...to here
openssl-3.5.5/include/internal/ktls.h:430:13: danger: dereference of NULL 'cmsg'
# 428| if (msg.msg_controllen > 0) {
# 429| cmsg = CMSG_FIRSTHDR(&msg);
# 430|-> if (cmsg->cmsg_type == TLS_GET_RECORD_TYPE) {
# 431| p[0] = *((unsigned char *)CMSG_DATA(cmsg));
# 432| p[1] = TLS1_2_VERSION_MAJOR;
Error: CPPCHECK_WARNING (CWE-457):
openssl-3.5.5/include/openssl/x509_vfy.h:124: warning[uninitvar]: Uninitialized variables: ptr.check_time, ptr.inh_flags, ptr.flags, ptr.purpose, ptr.trust, ptr.depth, ptr.auth_level, ptr.policies, ptr.hosts, ptr.hostflags, ptr.peername, ptr.email, ptr.emaillen, ptr.ip, ptr.iplen
# 122| #define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
# 123| #define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
# 124|-> SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
# 125| #define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
# 126| #define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
Error: COMPILER_WARNING (CWE-1164):
openssl-3.5.5/providers/fips/self_test_kats.c:943:12: warning[-Wunused-function]: 'self_test_asym_ciphers' defined but not used
# 943 | static int self_test_asym_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
# | ^~~~~~~~~~~~~~~~~~~~~~
# 941| }
# 942|
# 943|-> static int self_test_asym_ciphers(OSSL_SELF_TEST *st, OSSL_LIB_CTX *libctx)
# 944| {
# 945| int i, ret = 1;
Error: GCC_ANALYZER_WARNING (CWE-476):
openssl-3.5.5/ssl/quic/quic_record_shared.c:90:10: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
openssl-3.5.5/ssl/quic/quic_record_shared.c:84:13: enter_function: entry to 'el_teardown_keyslot'
openssl-3.5.5/ssl/quic/quic_record_shared.c:88:30: call_function: calling 'ossl_qrl_enc_level_set_get' from 'el_teardown_keyslot'
openssl-3.5.5/ssl/quic/quic_record_shared.c:88:30: return_function: returning to 'el_teardown_keyslot' from 'ossl_qrl_enc_level_set_get'
openssl-3.5.5/ssl/quic/quic_record_shared.c:90:10: danger: dereference of NULL 'ossl_qrl_enc_level_set_get(els, enc_level, 0)'
# 88| OSSL_QRL_ENC_LEVEL *el = ossl_qrl_enc_level_set_get(els, enc_level, 0);
# 89|
# 90|-> if (!ossl_qrl_enc_level_set_has_keyslot(els, enc_level, el->state, keyslot))
# 91| return;
# 92|
Error: CPPCHECK_WARNING (CWE-476):
openssl-3.5.5/ssl/quic/quic_record_tx.c:42: error[ctunullpointer]: Null pointer dereference: elem
# 40| };
# 41|
# 42|-> DEFINE_LIST_OF(txe, TXE);
# 43| typedef OSSL_LIST(txe) TXE_LIST;
# 44|
Error: CPPCHECK_WARNING (CWE-476):
openssl-3.5.5/ssl/quic/quic_record_tx.c:42: error[ctunullpointer]: Null pointer dereference: list
# 40| };
# 41|
# 42|-> DEFINE_LIST_OF(txe, TXE);
# 43| typedef OSSL_LIST(txe) TXE_LIST;
# 44|
Error: GCC_ANALYZER_WARNING (CWE-476):
openssl-3.5.5/ssl/quic/quic_record_tx.c:42:1: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
openssl-3.5.5/ssl/quic/quic_record_tx.c:795:5: enter_function: entry to 'ossl_qtx_write_pkt'
openssl-3.5.5/ssl/quic/quic_record_tx.c:804:8: branch_false: following 'false' branch...
openssl-3.5.5/ssl/quic/quic_record_tx.c:807:49: branch_false: ...to here
openssl-3.5.5/ssl/quic/quic_record_tx.c:812:13: branch_false: following 'false' branch...
openssl-3.5.5/ssl/quic/quic_record_tx.c:813:12: branch_false: ...to here
openssl-3.5.5/ssl/quic/quic_record_tx.c:812:14: branch_false: following 'false' branch...
openssl-3.5.5/ssl/quic/quic_record_tx.c:818:23: branch_false: ...to here
openssl-3.5.5/ssl/quic/quic_record_tx.c:835:12: branch_false: following 'false' branch...
openssl-3.5.5/ssl/quic/quic_record_tx.c:842:14: branch_false: ...to here
openssl-3.5.5/ssl/quic/quic_record_tx.c:842:14: call_function: inlined call to 'qtx_reserve_txe' from 'ossl_qtx_write_pkt'
# 40| };
# 41|
# 42|-> DEFINE_LIST_OF(txe, TXE);
# 43| typedef OSSL_LIST(txe) TXE_LIST;
# 44|
Error: COMPILER_WARNING:
openssl-3.5.5/ssl/ssl_ciph.c:12:9: warning: '_GNU_SOURCE' redefined
# 12 | #define _GNU_SOURCE
# | ^~~~~~~~~~~
<command-line>: note: this is the location of the previous definition
# 10| */
# 11|
# 12|-> #define _GNU_SOURCE
# 13| #include <stdio.h>
# 14| #include <ctype.h>
Error: COMPILER_WARNING:
openssl-3.5.5/ssl/ssl_ciph.c:12:9: warning[warning]: '_GNU_SOURCE' redefined
# 10| */
# 11|
# 12|-> #define _GNU_SOURCE
# 13| #include <stdio.h>
# 14| #include <ctype.h>
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/ssl/t1_lib.c: scope_hint: In function 'gid_cb'
openssl-3.5.5/ssl/t1_lib.c:1284:29: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 1284 | && ((current_prefix = strchr(prefixes, elem[0])) != NULL
# | ^
# 1282| /* Check the possible prefixes (remark: Leading and trailing spaces already cleared) */
# 1283| while (continue_while_loop && len > 0
# 1284|-> && ((current_prefix = strchr(prefixes, elem[0])) != NULL
# 1285| || OPENSSL_strncasecmp(current_prefix = (char *)DEFAULT_GROUPNAME_FIRST_CHARACTER, elem, 1) == 0)) {
# 1286|
Error: COMPILER_WARNING (CWE-704):
openssl-3.5.5/ssl/t1_lib.c:1284:29: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 1282| /* Check the possible prefixes (remark: Leading and trailing spaces already cleared) */
# 1283| while (continue_while_loop && len > 0
# 1284|-> && ((current_prefix = strchr(prefixes, elem[0])) != NULL
# 1285| || OPENSSL_strncasecmp(current_prefix = (char *)DEFAULT_GROUPNAME_FIRST_CHARACTER, elem, 1) == 0)) {
# 1286|