Fixed defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c: scope_hint: In function ‘create_cert’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:405:9: warning[-Wanalyzer-null-argument]: use of NULL ‘typ’ where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:25: included_from: Included from here.
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:624:19: note: in expansion of macro ‘g_strdup’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c: scope_hint: In function ‘create_cert’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:750:10: note: in expansion of macro ‘g_str_has_prefix’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c: scope_hint: In function ‘create_cert’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c: scope_hint: In function ‘create_cert’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:398:19: note: in expansion of macro ‘g_strdup’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c: scope_hint: In function ‘create_cert’
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_localca/swtpm_localca.c:19: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#  403|           options = concat_arrays(options, (gchar *[]){"--add-header", NULL}, TRUE);
#  404|   
#  405|->     if (strcmp(typ, "ek") == 0) {
#  406|           if (flags & ALLOW_SIGNING_F)
#  407|               options = concat_arrays(options, (gchar *[]){"--allow-signing", NULL}, TRUE);

Error: CLANG_WARNING: [#def2]
swtpm-0.8.1-build/swtpm-d2849a9f5ced70438d67036693438344b47b4161/src/swtpm_setup/swtpm_setup.c:404:21: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value
#  402|                   }
#  403|   
#  404|->                 if (certfile_move_or_delete(flags, !!(flags_to_certfiles[idx].flag & SETUP_EK_CERT_F),
#  405|                                               certfile, user_certsdir, key_description) != 0)
#  406|                       return 1;

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-7.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-nameswtpm-0.9.0-1.fc41
diffbase-store-results-to/tmp/tmpd5egy8vm/swtpm-0.9.0-1.fc41.tar.xz
diffbase-time-created2024-07-03 18:10:17
diffbase-time-finished2024-07-03 18:11:59
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpd5egy8vm/swtpm-0.9.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpd5egy8vm/swtpm-0.9.0-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-7.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameswtpm-0.8.1-5.fc40
store-results-to/tmp/tmp5pus4pzq/swtpm-0.8.1-5.fc40.tar.xz
time-created2024-07-03 18:07:54
time-finished2024-07-03 18:10:02
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp5pus4pzq/swtpm-0.8.1-5.fc40.tar.xz' '--gcc-analyze' '/tmp/tmp5pus4pzq/swtpm-0.8.1-5.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9