From: Stefan Berger Date: Thu, 26 Apr 2012 22:32:58 +0000 (-0400) Subject: macvtap: fix a typo X-Git-Tag: v0.9.12-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf9061e580d26f538404b67147d823e38a95258;p=thirdparty%2Flibvirt.git macvtap: fix a typo 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. /libvirt/src/util/virnetdevmacvlan.c:948: access_dbuff_const: Calling "virNetDevMacVLanVPortProfileRegisterCallback" indexes array "macaddress" at byte position 15. /libvirt/src/util/virnetdevmacvlan.c:773: access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15. Error: OVERRUN_STATIC: /libvirt/src/qemu/qemu_migration.c:2744: 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. /libvirt/src/util/virnetdevmacvlan.c:773: access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15. Error: OVERRUN_STATIC: /libvirt/src/qemu/qemu_driver.c:435: 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. /libvirt/src/util/virnetdevmacvlan.c:1036: access_dbuff_const: Calling "virNetDevMacVLanVPortProfileRegisterCallback" indexes array "macaddress" at byte position 15. /libvirt/src/util/virnetdevmacvlan.c:773: access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15. --- diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index a5a5f03bc6..401ee744d4 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -435,7 +435,7 @@ static const uint32_t modeMap[VIR_NETDEV_MACVLAN_MODE_LAST] = { struct virNetlinkCallbackData { char *cr_ifname; virNetDevVPortProfilePtr virtPortProfile; - unsigned char macaddress[VIR_UUID_BUFLEN]; + unsigned char macaddress[VIR_MAC_BUFLEN]; char *linkdev; int vf; unsigned char vmuuid[VIR_UUID_BUFLEN];