]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: use correct sizeof when allocating cpumap
authorJán Tomko <jtomko@redhat.com>
Thu, 29 Nov 2012 10:23:06 +0000 (11:23 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:53:40 +0000 (16:53 -0500)
commita565e20b082fd349c51789c0c396c4e5c014722f
tree3067cf90d143330df11992444ed70c25b08b5916
parente4e5a4d3494a34c43b7943ffda5899651198c353
virsh: use correct sizeof when allocating cpumap

Found by coverity:
Error: SIZEOF_MISMATCH (CWE-569):
    libvirt-0.10.2/tools/virsh-domain.c:4754: suspicious_sizeof: Passing
    argument "8UL /* sizeof (cpumap) */" to function
    "_vshCalloc(vshControl *, size_t, size_t, char const *, int)" and
    then casting the return value to "unsigned char *" is suspicious.

Error: SIZEOF_MISMATCH (CWE-569):
    libvirt-0.10.2/tools/virsh-domain.c:4942: suspicious_sizeof: Passing
    argument "8UL /* sizeof (cpumap) */" to function
    "_vshCalloc(vshControl *, size_t, size_t, char const *, int)" and
    then casting the return value to "unsigned char *" is suspicious.
(cherry picked from commit dc04b2a737c8c4240d0d412080ce798b977068a1)
tools/virsh-domain.c