New Defects reported by Coverity Scan for libvirt
by scan-admin@coverity.com
Hi,
Please find the latest report on new defect(s) introduced to libvirt found with Coverity Scan.
2 new defect(s) introduced to libvirt found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 307499: Control flow issues (DEADCODE)
/tools/virsh-domain.c: 715 in cmdAttachDisk()
________________________________________________________________________________________________________
*** CID 307499: Control flow issues (DEADCODE)
/tools/virsh-domain.c: 715 in cmdAttachDisk()
709 virBufferEscapeString(&hostAttrBuf, " name='%s'", host_name_copy);
710 virBufferEscapeString(&hostAttrBuf, " port='%s'", host_port);
711 }
712 virXMLFormatElement(&sourceChildBuf, "host", &hostAttrBuf, NULL);
713 break;
714
>>> CID 307499: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "case VIRSH_ATTACH_DISK_SOUR...".
715 case VIRSH_ATTACH_DISK_SOURCE_TYPE_NONE:
716 case VIRSH_ATTACH_DISK_SOURCE_TYPE_LAST:
717 break;
718 }
719 virXMLFormatElement(&diskChildBuf, "source", &sourceAttrBuf, &sourceChildBuf);
720
** CID 307498: Null pointer dereferences (NULL_RETURNS)
/tools/virsh-domain.c: 130 in virshAddressParse()
________________________________________________________________________________________________________
*** CID 307498: Null pointer dereferences (NULL_RETURNS)
/tools/virsh-domain.c: 130 in virshAddressParse()
124 g_autofree char *type = g_strdup(str);
125 char *a = strchr(type, ':');
126
127 if (!addr)
128 return -1;
129
>>> CID 307498: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing "a", which is known to be "NULL".
130 *a = '\0';
131
132 addr->type = virshAddressTypeFromString(type);
133
134 switch ((enum virshAddressType) addr->type) {
135 case VIRSH_ADDRESS_TYPE_PCI:
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my...