tpm2-tools-5.7-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c: scope_hint: In function ‘files_save_bytes_to_file’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:206:8: warning[-Wanalyzer-file-leak]: leak of FILE ‘<unknown>’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:579:5: note: in expansion of macro ‘BAIL_ON_NULL’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def3]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:206:8: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:785:1: note: in expansion of macro ‘SAVE_TYPE’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:579:5: note: in expansion of macro ‘BAIL_ON_NULL’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/files.c:580:5: note: in expansion of macro ‘BAIL_ON_NULL’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def4]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def5]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/object.c:304:8: warning[-Wmaybe-uninitialized]: 'val' may be used uninitialized
#  304 |     if (!is_persistent_parent) {
#      |        ^
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/object.c: scope_hint: In function 'tpm2_util_object_load2'
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def6]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/pcr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def8]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def9]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_alg_util.c: scope_hint: In function ‘handle_scheme_sign’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def10]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_alg_util.c:211:23: warning[-Wanalyzer-out-of-bounds]: buffer over-read
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_alg_util.c:205:13: note: in expansion of macro ‘do_scheme_halg’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_alg_util.c:211:23: note: read of 1 byte from after the end of ‘"null"’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def11]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_attr_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_auth_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def13]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_capability.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_convert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def15]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_errata.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def16]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_eventlog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def17]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def18]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_eventlog_yaml.c: scope_hint: In function ‘yaml_split_escape_string’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def19]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_eventlog_yaml.c: scope_hint: In function ‘yaml_split_print_string’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def20]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_hash.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def21]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_identity_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def22]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_kdfa.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def23]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_openssl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING: [#def24]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_openssl.c: scope_hint: In function ‘do_open_file’
tpm2-tools-5.7-build/tpm2-tools-5.7/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.7-build/tpm2-tools-5.7/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: [#def25]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_openssl.c: scope_hint: In function ‘do_stdin’
tpm2-tools-5.7-build/tpm2-tools-5.7/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.7-build/tpm2-tools-5.7/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: [#def26]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-476): [#def27]
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def28]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_policy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def29]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def30]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def31]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def32]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def33]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_util.c: scope_hint: In function ‘calc_phash_alg_from_phash_path’
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_util.c:1138: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
# 1136|        */
# 1137|       char *str = malloc(strlen(*phash_path) + 1);
# 1138|->     strcpy(str, *phash_path);
# 1139|       char *token = strtok(str, ":");
# 1140|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def34]
tpm2-tools-5.7-build/tpm2-tools-5.7/lib/tpm2_util.c:1147: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
# 1145|        */
# 1146|       if (hashalg != TPM2_ALG_ERROR) {
# 1147|->         *phash_path += strlen(token) + 1;
# 1148|       }
# 1149|   

Error: CPPCHECK_WARNING: [#def35]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def36]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_gettpm2object.c: scope_hint: In function ‘tss2_tool_onrun’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def37]
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def38]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_gettpmblobs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def39]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_quote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def40]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_sign.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def41]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_template.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-476): [#def42]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def43]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def44]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_template.c: scope_hint: In function ‘open_read_and_close’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def45]
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def46]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_verifyquote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def47]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/fapi/tss2_verifysignature.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def48]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/misc/tpm2_checkquote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def49]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/misc/tpm2_print.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def50]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/misc/tpm2_tr_encode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def51]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_commit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def52]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_createprimary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def53]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_dictionarylockout.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def54]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_duplicate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def55]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_duplicate.c: scope_hint: In function ‘openssl_create_duplicate’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def56]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_duplicate.c: scope_hint: In function ‘process_openssl_duplicate’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def57]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_encryptdecrypt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def58]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_encryptdecrypt.c: scope_hint: In function ‘process_inputs’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def59]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_evictcontrol.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def60]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_flushcontext.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def61]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_getcap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def62]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_getekcertificate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_getekcertificate.c: scope_hint: In function ‘process_input’
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_getekcertificate.c:777:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctx.out_public’
#  775|       if (ctx.ek_path) {
#  776|           ctx.out_public = malloc(sizeof(*ctx.out_public));
#  777|->         ctx.out_public->size = 0;
#  778|           bool res = files_load_public(ctx.ek_path, ctx.out_public);
#  779|           if (!res) {

Error: CPPCHECK_WARNING: [#def64]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_hmac.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def65]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_import.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def66]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_incrementalselftest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def67]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_loadexternal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def68]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_nvreadpublic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def69]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_nvreadpublic.c: scope_hint: In function ‘process_inputs’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def70]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_nvundefine.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def71]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_nvwrite.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def72]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_pcrevent.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_pcrevent.c: scope_hint: In function ‘on_arg’
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def74]
tpm2-tools-5.7-build/tpm2-tools-5.7/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): [#def75]
tpm2-tools-5.7-build/tpm2-tools-5.7/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.7-build/tpm2-tools-5.7/tools/tpm2_pcrevent.c:11: included_from: Included from here.
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_pcrevent.c:321:13: note: in expansion of macro ‘LOG_ERR’
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def76]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_policycountertimer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def77]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_policylocality.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def78]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_policynvwritten.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def79]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_policysigned.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def80]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_quote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def81]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_readpublic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def82]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_send.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-479): [#def83]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_send.c: scope_hint: In function ‘sig_handler’
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_send.c:29:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
tpm2-tools-5.7-build/tpm2-tools-5.7/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: [#def84]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_sign.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def85]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_tool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def86]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_verifysignature.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
tpm2-tools-5.7-build/tpm2-tools-5.7/tools/tpm2_verifysignature.c: scope_hint: In function ‘on_option’
tpm2-tools-5.7-build/tpm2-tools-5.7/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)) {

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-54.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nametpm2-tools-5.7-1.fc41
store-results-to/tmp/tmprtjgc5j0/tpm2-tools-5.7-1.fc41.tar.xz
time-created2024-07-03 18:20:37
time-finished2024-07-03 18:21:59
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmprtjgc5j0/tpm2-tools-5.7-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmprtjgc5j0/tpm2-tools-5.7-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9