[ovs-dev] [coverity3 01/13] bridge: Ethernet address is 6 bytes, not 4 or 8.

Ethan Jackson ethan at nicira.com
Wed Feb 23 21:34:36 UTC 2011


Ah oops, that's my bug.  Thanks for fixing it, looks good. Go ahead and push.

On Wed, Feb 23, 2011 at 1:24 PM, Ben Pfaff <blp at nicira.com> wrote:
> '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 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index c2c4579..a448e05 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];
> --
> 1.7.2.3
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>




More information about the dev mailing list