From 0b420b100ac540d45a45e45d40e6581b0c5f7eb5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 23 Feb 2011 11:21:52 -0800 Subject: [PATCH] bridge: Ethernet address is 6 bytes, not 4 or 8. 'ea' here is a function parameter declared as an array, so "sizeof ea" is sizeof(uint8_t *), which is either 4 or 8. Coverity #10689, 10735. --- vswitchd/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index c2c4579c..a448e05c 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -981,7 +981,7 @@ bridge_pick_local_hw_addr(struct bridge *br, uint8_t ea[ETH_ADDR_LEN], /* Otherwise choose the minimum non-local MAC address among all of the * interfaces. */ - memset(ea, 0xff, sizeof ea); + memset(ea, 0xff, ETH_ADDR_LEN); for (i = 0; i < br->n_ports; i++) { struct port *port = br->ports[i]; uint8_t iface_ea[ETH_ADDR_LEN]; -- 2.30.2