aboutsummaryrefslogtreecommitdiffstats
path: root/main/qemu/CVE-2014-0150.patch
blob: aa25f5c50857747431c5efaee16a452578dc7b98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 5320aab..a42d241 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
 <at>  <at>  -655,7 +655,7  <at>  <at>  static int virtio_net_handle_mac(VirtIONet *n,
uint8_t cmd,
         goto error;
     }

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

--