Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
/usr/include/stdio.h: scope_hint: In function ‘main’
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c: scope_hint: In function ‘testSELinuxLoadFileList’
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c: scope_hint: In function ‘hostCPUSignature’
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:193:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:193:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-69.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namelibvirt-10.6.0-5.fc41
diffbase-store-results-to/tmp/tmp7k57ns1y/libvirt-10.6.0-5.fc41.tar.xz
diffbase-time-created2024-11-13 01:44:43
diffbase-time-finished2024-11-13 01:57:28
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp7k57ns1y/libvirt-10.6.0-5.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp7k57ns1y/libvirt-10.6.0-5.fc41.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-69.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibvirt-10.9.0-1.fc42
store-results-to/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.tar.xz
time-created2024-11-13 01:57:44
time-finished2024-11-13 02:09:54
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9