summary refs log tree commit diff
path: root/pkgs/applications/virtualization/qemu/cve-2014-0150.patch
blob: a086b3693215431cb51247de2fc971b3949465cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 439477b..33bd233 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
 <at>  <at>  -677,7 +677,7  <at>  <at>  static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
         goto error;
     }

-    if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
+    if (mac_data.entries <= MAC_TABLE_ENTRIES - in_use) {
         s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN],
                        mac_data.entries * ETH_ALEN);
         if (s != mac_data.entries * ETH_ALEN) {