Task #874 - added.err
back to task #874download
Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/conf/virdomainmomentobjlist.c:380:13: warning[core.NullDereference]: Dereference of null pointer (loaded from variable '_pp') # 378| if (data.error) { # 379| for (i = 0; i < data.count; i++) # 380|-> VIR_FREE(names[i]); # 381| return -1; # 382| } Error: GCC_ANALYZER_WARNING (CWE-465): libvirt-10.4.0-build/libvirt-10.4.0/src/hyperv/hyperv_wmi.c: scope_hint: In function ‘hypervFreeObject.part.0’ libvirt-10.4.0-build/libvirt-10.4.0/src/hyperv/hyperv_wmi.c:1011:19: warning[-Wanalyzer-deref-before-check]: check of ‘object’ for NULL after already dereferencing it # 1009| serializerContext = wsmc_get_serialization_context(((hypervObject *)object)->priv->client); # 1010| # 1011|-> while (object != NULL) { # 1012| next = ((hypervObject *)object)->next; # 1013| Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/hypervisor/domain_interface.c:397:22: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 395| ignore_value(virNetDevMidonetUnbindPort(vport)); # 396| } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) { # 397|-> ignore_value(virNetDevOpenvswitchRemovePort(net->ifname)); # 398| } # 399| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/lxc/lxc_native.c:747:20: warning[core.NullDereference]: Array access (via field 'ips') results in a null pointer dereference # 745| lxcNetworkParseData *data = networks.parseData[i]; # 746| for (j = 0; j < data->nips; j++) # 747|-> g_free(data->ips[j]); # 748| g_clear_pointer(&data->ips, g_free); # 749| } Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzReadConfigParam’ libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’ # 618| char *sf, *token, *saveptr = NULL; # 619| # 620|-> fp = fopen(conf_file, "r"); # 621| if (fp == NULL) # 622| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’ # 618| char *sf, *token, *saveptr = NULL; # 619| # 620|-> fp = fopen(conf_file, "r"); # 621| if (fp == NULL) # 622| return -1; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvz_copyfile’ libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(from_path, "r")’ # 680| int bytes_read; # 681| # 682|-> fp = fopen(from_path, "r"); # 683| if (fp == NULL) # 684| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(from_path, "r")’ # 680| int bytes_read; # 681| # 682|-> fp = fopen(from_path, "r"); # 683| if (fp == NULL) # 684| return -1; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzGetVPSUUID’ libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’ # 820| return -1; # 821| # 822|-> fp = fopen(conf_file, "r"); # 823| if (fp == NULL) # 824| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’ # 820| return -1; # 821| # 822|-> fp = fopen(conf_file, "r"); # 823| if (fp == NULL) # 824| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzSetDefinedUUID’ libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "a")’ # 874| # 875| if (uuidstr[0] == 0) { # 876|-> fp = fopen(conf_file, "a"); /* append */ # 877| if (fp == NULL) # 878| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "a")’ # 874| # 875| if (uuidstr[0] == 0) { # 876|-> fp = fopen(conf_file, "a"); /* append */ # 877| if (fp == NULL) # 878| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_driver.c: scope_hint: In function ‘openvzGetProcessInfo’ libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/vz/vestat", "r")’ # 1416| */ # 1417| # 1418|-> if ((fp = fopen("/proc/vz/vestat", "r")) == NULL) # 1419| return -1; # 1420| Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/vz/vestat", "r")’ # 1416| */ # 1417| # 1418|-> if ((fp = fopen("/proc/vz/vestat", "r")) == NULL) # 1419| return -1; # 1420| Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/remote/remote_daemon_dispatch.c:226:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'def' # 224| # 225| cleanup: # 226|-> ignore_value(virIdentitySetCurrent(NULL)); # 227| return ret; # 228| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/remote/remote_daemon_dispatch.c:251:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'def' # 249| # 250| cleanup: # 251|-> ignore_value(virIdentitySetCurrent(NULL)); # 252| return ret; # 253| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/remote/remote_daemon_dispatch.c:278:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'def' # 276| # 277| cleanup: # 278|-> ignore_value(virIdentitySetCurrent(NULL)); # 279| return ret; # 280| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/remote/remote_daemon_dispatch.c:303:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'def' # 301| # 302| cleanup: # 303|-> ignore_value(virIdentitySetCurrent(NULL)); # 304| return ret; # 305| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/security/security_dac.c:823:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 821| path = src->path; # 822| # 823|-> if (!virFileExists(path)) # 824| return 0; # 825| Error: GCC_ANALYZER_WARNING (CWE-688): libvirt-10.4.0-build/libvirt-10.4.0/src/storage/storage_util.c: scope_hint: In function ‘virStorageBackendBuildLocal’ libvirt-10.4.0-build/libvirt-10.4.0/src/storage/storage_util.c:2785:15: warning[-Wanalyzer-null-argument]: use of NULL 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. libvirt-10.4.0-build/libvirt-10.4.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:30: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/datatypes.h:24: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/storage/storage_util.c:46: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/storage/storage_util.c:2784:14: note: in expansion of macro ‘g_strdup’ libvirt-10.4.0-build/libvirt-10.4.0/src/storage/storage_util.c: scope_hint: In function ‘virStorageBackendBuildLocal’ libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:28: included_from: Included from here. /usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null # 2783| # 2784| parent = g_strdup(def->target.path); # 2785|-> if (!(p = strrchr(parent, '/'))) { # 2786| virReportError(VIR_ERR_INVALID_ARG, # 2787| _("path '%1$s' is not absolute"), Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:27: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c: scope_hint: In function ‘virFirewallNewFromRollback’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/viralloc.h:116:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:224:9: note: in expansion of macro ‘VIR_RESIZE_N’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:990:17: note: in expansion of macro ‘ADD_ARG’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:482:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:482:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:987:37: note: in expansion of macro ‘virFirewallAddCmd’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:242:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:242:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:987:37: note: in expansion of macro ‘virFirewallAddCmd’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:224:9: note: in expansion of macro ‘VIR_RESIZE_N’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:990:17: note: in expansion of macro ‘ADD_ARG’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:224:9: note: in expansion of macro ‘VIR_RESIZE_N’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:990:17: note: in expansion of macro ‘ADD_ARG’ # 114| */ # 115| #define VIR_RESIZE_N(ptr, alloc, count, add) \ # 116|-> virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add) # 117| # 118| /** Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c: scope_hint: In function ‘virFirewallCmdToString’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:546:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fwCmd’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:30: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:905:5: note: in expansion of macro ‘VIR_DEBUG’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.h:23: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:25: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:79:29: note: in definition of macro ‘STREQ’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:685:13: note: in expansion of macro ‘VIR_NFTABLES_ARG_IS_CREATE’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:242:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:242:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:443:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:443:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:443:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:443:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’ # 544| # 545| virBufferAdd(&buf, cmd, -1); # 546|-> for (i = 0; i < fwCmd->argsLen; i++) { # 547| virBufferAddLit(&buf, " "); # 548| virBufferAdd(&buf, fwCmd->args[i], -1); Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:995:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'firewall' # 993| # 994| if (firewall->ngroups == 0) # 995|-> VIR_DEBUG("original firewall object is empty"); # 996| else # 997| *fwRemoval = g_steal_pointer(&firewall); Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfirewall.c:1077:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'newfw' # 1075| ngroups = virXPathNodeSet("./group", ctxt, &groupNodes); # 1076| if (ngroups < 0) # 1077|-> return -1; # 1078| # 1079| for (g = 0; g < ngroups; g++) { Error: GCC_ANALYZER_WARNING (CWE-688): libvirt-10.4.0-build/libvirt-10.4.0/src/util/virutil.c: scope_hint: In function ‘virParseOwnershipIds’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virutil.c:1383:11: warning[-Wanalyzer-null-argument]: use of NULL 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. libvirt-10.4.0-build/libvirt-10.4.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:30: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virerror.h:24: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virutil.c:49: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/virutil.c:1380:17: note: in expansion of macro ‘g_strdup’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virutil.c: scope_hint: In function ‘virParseOwnershipIds’ <built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null # 1381| # 1382| /* Split label */ # 1383|-> sep = strchr(tmp_label, ':'); # 1384| if (sep == NULL) { # 1385| virReportError(VIR_ERR_INVALID_ARG, Error: GCC_ANALYZER_WARNING (CWE-688): libvirt-10.4.0-build/libvirt-10.4.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-10.4.0-build/libvirt-10.4.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected libvirt-10.4.0-build/libvirt-10.4.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): libvirt-10.4.0-build/libvirt-10.4.0/tests/commandhelper.c: scope_hint: In function ‘main’ libvirt-10.4.0-build/libvirt-10.4.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-10.4.0-build/libvirt-10.4.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): libvirt-10.4.0-build/libvirt-10.4.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-10.4.0-build/libvirt-10.4.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: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/tests/qemumonitorjsontest.c:415:5: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 413| for (i = 0; i < ninfo; i++) # 414| qemuMonitorMachineInfoFree(info[i]); # 415|-> VIR_FREE(info); # 416| # 417| return ret; Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/tests/qemumonitorjsontest.c:878:5: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 876| for (i = 0; i < npaths; i++) # 877| qemuMonitorJSONListPathFree(paths[i]); # 878|-> VIR_FREE(paths); # 879| return ret; # 880| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/tests/qemumonitorjsontest.c:2217:5: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 2215| for (i = 0; i < ninfo; i++) # 2216| VIR_FREE(info[i]); # 2217|-> VIR_FREE(info); # 2218| # 2219| return ret; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/tests/securityselinuxlabeltest.c: scope_hint: In function ‘testSELinuxLoadFileList’ libvirt-10.4.0-build/libvirt-10.4.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.4.0-build/libvirt-10.4.0/tests", testname), "r")’ # 105| testname); # 106| # 107|-> if (!(fp = fopen(path, "r"))) # 108| return -1; # 109| Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.4.0-build/libvirt-10.4.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.4.0-build/libvirt-10.4.0/tests", testname), "r")’ # 105| testname); # 106| # 107|-> if (!(fp = fopen(path, "r"))) # 108| return -1; # 109| Error: GCC_ANALYZER_WARNING (CWE-127): libvirt-10.4.0-build/libvirt-10.4.0/tests/testutils.c: scope_hint: In function ‘virTestDifferenceFullInternal’ libvirt-10.4.0-build/libvirt-10.4.0/tests/testutils.c:413:30: warning[-Wanalyzer-out-of-bounds]: buffer under-read /usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here. /usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here. /usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here. /usr/include/glib-2.0/glib.h:32: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:30: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/util/viralloc.h:25: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tests/testutils.h:23: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tests/testutils.c:29: included_from: Included from here. /usr/include/glib-2.0/glib/gmacros.h:1358:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’ /usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfile.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’ /usr/include/glib-2.0/glib/gmacros.h:1372:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’ libvirt-10.4.0-build/libvirt-10.4.0/src/util/virfile.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’ libvirt-10.4.0-build/libvirt-10.4.0/tests/testutils.c:413:30: note: valid subscripts for ‘""’ are ‘[0]’ to ‘[0]’ # └──────────────────────────────────┘ # ^ # 411| while (actualEnd > actualStart && # 412| expectEnd > expectStart && # 413|-> *actualEnd == *expectEnd) { # 414| actualEnd--; # 415| expectEnd--; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.4.0-build/libvirt-10.4.0/tests/virhostcputest.c: scope_hint: In function ‘hostCPUSignature’ libvirt-10.4.0-build/libvirt-10.4.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.4.0-build/libvirt-10.4.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): libvirt-10.4.0-build/libvirt-10.4.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.4.0-build/libvirt-10.4.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: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/tests/virshtest.c:149:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'doc' # 147| # 148| if ((fd = open(pipepath, O_WRONLY)) < 0) { # 149|-> fprintf(stderr, "\nfailed to open pipe '%s': %s\n", pipepath, g_strerror(errno)); # 150| return; # 151| } Error: CLANG_WARNING: libvirt-10.4.0-build/libvirt-10.4.0/tests/virshtest.c:395:5: warning[deadcode.DeadStores]: Value stored to 'need_readline' is never read # 393| DO_TEST_SCRIPT("completion", NULL, VIRSH_DEFAULT); # 394| # 395|-> need_readline = false; # 396| # 397| if (virTestRun("read-big-pipe", testVirshPipe, NULL) < 0) Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.c: scope_hint: In function ‘vshCommandOptArgvString’ libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.c:1283:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘opt’ /usr/include/bits/types/struct_iovec.h:23: included_from: Included from here. /usr/include/bits/fcntl-linux.h:38: included_from: Included from here. /usr/include/bits/fcntl.h:61: included_from: Included from here. /usr/include/fcntl.h:35: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.c:27: included_from: Included from here. /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. libvirt-10.4.0-build/libvirt-10.4.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/src/internal.h:30: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.h:28: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.c:22: included_from: Included from here. libvirt-10.4.0-build/libvirt-10.4.0/tools/vsh.c:3536:28: note: in expansion of macro ‘g_strdup’ # 1281| return NULL; # 1282| # 1283|-> if (!opt->argvstr) # 1284| opt->argvstr = g_strjoinv(" ", opt->argv); # 1285|