Task #1994 - tpm2-tools-5.6-2.fc40/scan-results.err
back to task #1994download
Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c: scope_hint: In function ‘files_save_bytes_to_file’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:206:8: warning[-Wanalyzer-file-leak]: leak of FILE ‘<unknown>’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:579:5: note: in expansion of macro ‘BAIL_ON_NULL’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’ # 204| } # 205| # 206|-> if (fp != stdout) { # 207| fclose(fp); # 208| } Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:206:8: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:579:5: note: in expansion of macro ‘BAIL_ON_NULL’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’ # 204| } # 205| # 206|-> if (fp != stdout) { # 207| fclose(fp); # 208| } Error: CLANG_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/log.c:21:17: warning[deadcode.DeadStores]: Value stored to 'value' during its initialization is never read # 19| static const char * # 20| get_level_msg(log_level level) { # 21|-> const char *value = "UNK"; # 22| switch (level) { # 23| case log_level_error: Error: COMPILER_WARNING (CWE-457): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/object.c:304:8: warning[-Wmaybe-uninitialized]: 'val' may be used uninitialized # 304 | if (!is_persistent_parent) { # | ^ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/object.c: scope_hint: In function 'tpm2_util_object_load2' tpm2-tools-5.6-build/tpm2-tools-5.6/lib/object.c:297:14: note: 'val' was declared here # 297 | uint64_t val; # | ^ # 302| # 303| bool is_persistent_parent = (val != TPM2_RH_OWNER && val != 0); # 304|-> if (!is_persistent_parent) { # 305| ESYS_TR obj_parent = ESYS_TR_NONE; # 306| rc = tpm2_util_object_setup_primary(ctx, &obj_parent); Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/pcr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-471): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c: scope_hint: In function ‘handle_scheme_sign’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c:188:16: warning[-Wanalyzer-write-to-string-literal]: write to string literal # 186| char *split = strchr(scheme, '-'); # 187| if (split) { # 188|-> *split = '\0'; # 189| halg = split + 1; # 190| } Error: GCC_ANALYZER_WARNING (CWE-126): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c:211:23: warning[-Wanalyzer-out-of-bounds]: buffer over-read tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c:205:13: note: in expansion of macro ‘do_scheme_halg’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c:211:23: note: read of 1 byte from after the end of ‘"null"’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_alg_util.c:211:23: note: valid subscripts for ‘"null"’ are ‘[0]’ to ‘[4]’ # └─────────────────────────────┘ # ^ # 209| * commit-id. # 210| */ # 211|-> if (scheme[0] == '\0') { # 212| scheme = "0"; # 213| } Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_attr_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_auth_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_capability.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_convert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_errata.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog_yaml.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog_yaml.c: scope_hint: In function ‘yaml_split_escape_string’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog_yaml.c:352:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 350| # 351| tmp = realloc(lines, sizeof(char *) * (nlines + 2)); # 352|-> if (!tmp) { # 353| LOG_ERR("failed to allocate memory for description lines: %s\n", # 354| strerror(errno)); Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog_yaml.c: scope_hint: In function ‘yaml_split_print_string’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_eventlog_yaml.c:471:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 469| free(lines[i]); # 470| } # 471|-> free(lines); # 472| return true; # 473| } Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_hash.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_identity_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_kdfa.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c: scope_hint: In function ‘do_open_file’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c:433:31: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument # 433 | char *tmp = calloc(sizeof(char), file_size + 1); # | ^~~~ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c:433:31: note: earlier argument should specify number of elements, later size of each element # 431| } # 432| # 433|-> char *tmp = calloc(sizeof(char), file_size + 1); # 434| if (!tmp) { # 435| LOG_ERR("oom"); Error: COMPILER_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c: scope_hint: In function ‘do_stdin’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c:488:31: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument # 488 | void *buf = calloc(sizeof(BYTE), UINT16_MAX + 1); # | ^~~~ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_openssl.c:488:31: note: earlier argument should specify number of elements, later size of each element # 486| UNUSED(passin); # 487| # 488|-> void *buf = calloc(sizeof(BYTE), UINT16_MAX + 1); # 489| if (!buf) { # 490| LOG_ERR("oom"); Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_options.c:201: warning[nullPointer]: Possible null pointer dereference: tcti_default # 199| # 200| printf("tool=\"%s\" version=\"%s\" tctis=\"libtss2-tctildr\" tcti-default=%s\n", # 201|-> name, VERSION, tcti_default); # 202| Tss2_TctiLdr_FreeInfo(&info); # 203| } Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_policy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c:277: warning[uninitvar]: Uninitialized variable: converted # 275| } # 276| # 277|-> STRING_BYTES_ENDIAN_CONVERT(16) # 278| STRING_BYTES_ENDIAN_CONVERT(32) # 279| STRING_BYTES_ENDIAN_CONVERT(64) Error: CPPCHECK_WARNING (CWE-457): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c:278: warning[uninitvar]: Uninitialized variable: converted # 276| # 277| STRING_BYTES_ENDIAN_CONVERT(16) # 278|-> STRING_BYTES_ENDIAN_CONVERT(32) # 279| STRING_BYTES_ENDIAN_CONVERT(64) # 280| Error: CPPCHECK_WARNING (CWE-457): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c:279: warning[uninitvar]: Uninitialized variable: converted # 277| STRING_BYTES_ENDIAN_CONVERT(16) # 278| STRING_BYTES_ENDIAN_CONVERT(32) # 279|-> STRING_BYTES_ENDIAN_CONVERT(64) # 280| # 281| #define STRING_BYTES_ENDIAN_HTON(size) \ Error: GCC_ANALYZER_WARNING (CWE-688): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c: scope_hint: In function ‘calc_phash_alg_from_phash_path’ tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c:1130:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘str’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 1128| */ # 1129| char *str = malloc(strlen(*phash_path) + 1); # 1130|-> strcpy(str, *phash_path); # 1131| char *token = strtok(str, ":"); # 1132| Error: GCC_ANALYZER_WARNING (CWE-688): tpm2-tools-5.6-build/tpm2-tools-5.6/lib/tpm2_util.c:1139:24: warning[-Wanalyzer-null-argument]: use of NULL ‘token’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 1137| */ # 1138| if (hashalg != TPM2_ALG_ERROR) { # 1139|-> *phash_path += strlen(token) + 1; # 1140| } # 1141| Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_gettpm2object.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_gettpm2object.c: scope_hint: In function ‘tss2_tool_onrun’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_gettpm2object.c:70:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘stream’ # 68| if (!ctx.path) { # 69| fprintf (stderr, "path is missing, use --path\n"); # 70|-> return -1; # 71| } # 72| Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_gettpm2object.c:70:16: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’ # 68| if (!ctx.path) { # 69| fprintf (stderr, "path is missing, use --path\n"); # 70|-> return -1; # 71| } # 72| Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_gettpmblobs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_quote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_sign.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c:222: warning[nullPointer]: Possible null pointer dereference: description # 220| printf("%s:", (const char *) userdata); # 221| } else { # 222|-> printf ("Authorize %s \"%s\": ", objectPath, description); # 223| } # 224| tcsetattr (STDIN_FILENO, TCSANOW, &new); Error: CPPCHECK_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c:222: warning[nullPointer]: Possible null pointer dereference: objectPath # 220| printf("%s:", (const char *) userdata); # 221| } else { # 222|-> printf ("Authorize %s \"%s\": ", objectPath, description); # 223| } # 224| tcsetattr (STDIN_FILENO, TCSANOW, &new); Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c: scope_hint: In function ‘open_read_and_close’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c:640:20: warning[-Wanalyzer-malloc-leak]: leak of ‘*input’ # 638| break; # 639| buffer_size += 1024; # 640|-> *input = realloc (*input, buffer_size + 1); # 641| if (!*input) { # 642| fprintf (stderr, "realloc(3) failed: %m\n"); Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_template.c:640:20: warning[-Wanalyzer-malloc-leak]: leak of ‘input_signature’ # 638| break; # 639| buffer_size += 1024; # 640|-> *input = realloc (*input, buffer_size + 1); # 641| if (!*input) { # 642| fprintf (stderr, "realloc(3) failed: %m\n"); Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_verifyquote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/fapi/tss2_verifysignature.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/misc/tpm2_checkquote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/misc/tpm2_print.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/misc/tpm2_tr_encode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_commit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_createprimary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_dictionarylockout.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_duplicate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_duplicate.c: scope_hint: In function ‘openssl_create_duplicate’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_duplicate.c:182:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ctx.out_private_data’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 180| # 181| ctx.out_private_data = malloc(private.size + sizeof(private.size)); # 182|-> memcpy(ctx.out_private_data, &private, private.size + sizeof(private.size)); # 183| # 184| out: Error: GCC_ANALYZER_WARNING (CWE-688): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_duplicate.c: scope_hint: In function ‘process_openssl_duplicate’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_duplicate.c:234:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ctx.out_sym_seed’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 232| ctx.out_sym_seed = malloc(encrypted_seed.size + # 233| sizeof(encrypted_seed.size)); # 234|-> memcpy(ctx.out_sym_seed, &encrypted_seed, # 235| encrypted_seed.size + sizeof(encrypted_seed.size)); # 236| Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_encryptdecrypt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_encryptdecrypt.c: scope_hint: In function ‘process_inputs’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_encryptdecrypt.c:378:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx.iv_in’ # 376| } else { # 377| ctx.iv_in = malloc(iv_start.size + sizeof(iv_start)); # 378|-> ctx.iv_in->size = iv_start.size; # 379| memcpy(ctx.iv_in->buffer, &iv_start.buffer, iv_start.size); # 380| } Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_evictcontrol.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_flushcontext.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_getcap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_getekcertificate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_getekcertificate.c: scope_hint: In function ‘process_input’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_getekcertificate.c:779:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx.out_public’ # 777| if (ctx.ek_path) { # 778| ctx.out_public = malloc(sizeof(*ctx.out_public)); # 779|-> ctx.out_public->size = 0; # 780| bool res = files_load_public(ctx.ek_path, ctx.out_public); # 781| if (!res) { Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_hmac.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_import.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_incrementalselftest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_loadexternal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_nvreadpublic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_nvreadpublic.c: scope_hint: In function ‘process_inputs’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_nvreadpublic.c:245:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx.nv_public_list’ # 243| */ # 244| if (!ctx.is_command_dispatch) { # 245|-> ctx.nv_public_list[0] = malloc(sizeof(TPM2B_NV_PUBLIC)); # 246| } # 247| Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_nvundefine.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_nvwrite.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c: scope_hint: In function ‘on_arg’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:320:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "rb")’ # 318| FILE *x = fopen(argv[i], "rb"); # 319| /* file already found but got another file */ # 320|-> if (f && x) { # 321| LOG_ERR("Only expected one file input"); # 322| fclose(x); Error: GCC_ANALYZER_WARNING (CWE-401): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:320:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "rb")’ # 318| FILE *x = fopen(argv[i], "rb"); # 319| /* file already found but got another file */ # 320|-> if (f && x) { # 321| LOG_ERR("Only expected one file input"); # 322| fclose(x); Error: GCC_ANALYZER_WARNING (CWE-688): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:322:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(*<unknown>, "rb")’ where non-null expected tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:11: included_from: Included from here. tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:321:13: note: in expansion of macro ‘LOG_ERR’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_pcrevent.c:6: included_from: Included from here. /usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null # 320| if (f && x) { # 321| LOG_ERR("Only expected one file input"); # 322|-> fclose(x); # 323| goto error; # 324| /* looking for file and got a file so assign */ Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_policycountertimer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_policylocality.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_policynvwritten.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_policysigned.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_quote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_readpublic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_send.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-479): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_send.c: scope_hint: In function ‘sig_handler’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_send.c:29:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_send.c:29:5: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 27| UNUSED(signum); # 28| # 29|-> exit (tool_rc_success); # 30| } # 31| Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_sign.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_tool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_verifysignature.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_verifysignature.c: scope_hint: In function ‘on_option’ tpm2-tools-5.6-build/tpm2-tools-5.6/tools/tpm2_verifysignature.c:199:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx.msg_hash’ # 197| case 'd': { # 198| ctx.msg_hash = malloc(sizeof(TPM2B_DIGEST)); # 199|-> ctx.msg_hash->size = sizeof(ctx.msg_hash->buffer); # 200| if (!files_load_bytes_from_path(value, ctx.msg_hash->buffer, # 201| &ctx.msg_hash->size)) {