Task #52315 - fixed.err
back to task #52315download
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_memory: allocated here
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:8: release_memory: assuming ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’ is NULL
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:8: branch_true: following ‘true’ branch...
<unknown>: branch_true: ...to here
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:348:34: call_function: inlined call to ‘cleanupFile’ from ‘main’
# 71| {
# 72| FILE *file = *ptr;
# 73|-> fclose(file);
# 74| }
# 75|
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_resource: opened here
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: danger: ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 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):
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_memory: allocated here
libvirt-11.0.0/redhat-linux-build/../tests/commandhelper.c:350:17: danger: ‘fopen("/builddir/build/BUILD/libvirt-11.0.0/redhat-linux-build/tests/commandhelper.log", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 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):
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.0.0/tests", testname), "r")’
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: acquire_resource: opened here
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: danger: ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.0.0/tests", testname), "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 105| testname);
# 106|
# 107|-> if (!(fp = fopen(path, "r")))
# 108| return -1;
# 109|
Error: GCC_ANALYZER_WARNING (CWE-401):
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.0.0/tests", testname), "r")’
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: acquire_memory: allocated here
libvirt-11.0.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: danger: ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.0.0/tests", testname), "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 105| testname);
# 106|
# 107|-> if (!(fp = fopen(path, "r")))
# 108| return -1;
# 109|
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-11.0.0/redhat-linux-build/../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-11.0.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
libvirt-11.0.0/redhat-linux-build/../tests/virhostcputest.c:193:15: acquire_resource: opened here
libvirt-11.0.0/redhat-linux-build/../tests/virhostcputest.c:193:15: danger: ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.0.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 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):
libvirt-11.0.0/redhat-linux-build/../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-11.0.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
libvirt-11.0.0/redhat-linux-build/../tests/virhostcputest.c:193:15: acquire_memory: allocated here
libvirt-11.0.0/redhat-linux-build/../tests/virhostcputest.c:193:15: danger: ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.0.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 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: COMPILER_WARNING:
libvirt-11.0.0/src/util/virsystemd.c: scope_hint: In function ‘virSystemdEscapeName’
libvirt-11.0.0/src/util/virsystemd.c:59:38: warning[-Wunterminated-string-initialization]: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available)
# 59 | static const char hextable[16] = "0123456789abcdef";
# | ^~~~~~~~~~~~~~~~~~
# 57| const char *name)
# 58| {
# 59|-> static const char hextable[16] = "0123456789abcdef";
# 60|
# 61| #define ESCAPE(c) \