[libvirt] [PATCH] macvtap: fix a typo

Eric Blake eblake at redhat.com
Thu Apr 26 21:28:06 UTC 2012


On 04/26/2012 03:16 PM, Stefan Berger wrote:
> Below patch fixes the following coverity findings
> 
> Error: OVERRUN_STATIC:
> /libvirt/src/qemu/qemu_command.c:152:
> overrun-buffer-val: Overrunning static array "net->mac" of size 6 bytes
> by passing it as an argument to a function which indexes it at byte
> position 15.

> 
> Index: libvirt-acl/src/util/virnetdevmacvlan.c
> ===================================================================
> --- libvirt-acl.orig/src/util/virnetdevmacvlan.c
> +++ libvirt-acl/src/util/virnetdevmacvlan.c
> @@ -435,7 +435,7 @@ static const uint32_t modeMap[VIR_NETDEV
>  struct virNetlinkCallbackData {
>      char *cr_ifname;
>      virNetDevVPortProfilePtr virtPortProfile;
> -    unsigned char macaddress[VIR_UUID_BUFLEN];
> +    unsigned char macaddress[VIR_MAC_BUFLEN];

Yep, any client that uses sizeof() was picking up 10 bytes of garbage.  ACK.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120426/45ef3339/attachment-0001.sig>


More information about the libvir-list mailing list