On Fri, Feb 20, 2015 at 09:28:16PM +0100, Thomas Graf wrote:
> On 02/20/15 at 11:16am, Ben Pfaff wrote:
> > diff --git a/lib/ovs-router.c b/lib/ovs-router.c
> > index 8de2e2d..bf205d6 100644
> > --- a/lib/ovs-router.c
> > +++ b/lib/ovs-router.c
> > @@ -72,7 +72,7 @@ ovs_router_lookup(ovs_be32 ip_dst, char output_bridge[], 
> > ovs_be32 *gw)
> >      if (cr) {
> >          struct ovs_router_entry *p = ovs_router_entry_cast(cr);
> >  
> > -        strncpy(output_bridge, p->output_bridge, IFNAMSIZ);
> > +        ovs_strlcpy(output_bridge, p->output_bridge, IFNAMSIZ);
> >          *gw = p->gw;
> >          return true;
> >      }
> > diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c
> > index e6739b9..c8b2615 100644
> > --- a/lib/tnl-ports.c
> > +++ b/lib/tnl-ports.c
> > @@ -101,7 +101,7 @@ tnl_port_map_insert(odp_port_t port, ovs_be32 ip_dst, 
> > ovs_be16 udp_port,
> >  
> >          cls_rule_init(&p->cr, &match, 0);   /* Priority == 0. */
> >          ovs_refcount_init(&p->ref_cnt);
> > -        strncpy(p->dev_name, dev_name, IFNAMSIZ);
> > +        ovs_strlcpy(p->dev_name, dev_name, IFNAMSIZ);
> >  
> >          classifier_insert(&cls, &p->cr, NULL, 0);
> >      }
> 
> Nit: The above 2 still use IFNAMSIZ as dst.

In ovs_router_lookup() we can't use sizeof output_bridge since that's
just sizeof(char*).

I did overlook the other one.  Fixed.

> Otherwise:
> Acked-by: Thomas Graf <tg...@noironetworks.com>

Thanks, applied.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to