New Defects reported by Coverity Scan for libvirt

scan-admin at coverity.com scan-admin at coverity.com
Tue Nov 24 08:41:49 UTC 2020


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-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yqXyKjvBooc6PgQklkMPQjdETL0zD-2BwwS2MT3CUz0PGk4uLnDSo8-2B2mZ3lSeSytwjA-3DdDQe_CkO38-2FnXVYPAlDbR1ZxdHNqvqoSWeUuqu9763V-2FVMwwbWLm03fZJLw1YXqZSwtKUJgKjgbZeSX6G4MP9LPKVExgeBtnAhcCtsAlbRZv-2Fwl12YQz0YkBdG64AlgJKLSwxmOcZBis7K0jbc9Xc5SIAxFzbmiLNQiFcdriqPq0y5oi-2FemtSP1zhntvIW-2BCs3QQlq-2B8WXaGwFRlbOqSfJwikj4y4C7GvLlcUkavKNXhulKg-3D




More information about the Libvirt-ci mailing list