[ovs-dev] [PATCH v2] netdev-dpdk: fix snprintf call

Ben Pfaff blp at ovn.org
Fri Jun 15 18:26:36 UTC 2018


On Fri, Jun 15, 2018 at 05:56:28PM +0300, Ilya Maximets wrote:
> > lib/netdev-dpdk.c: In function :
> > lib/netdev-dpdk.c:2865:49: warning:  output may be truncated before the last format character [-Wformat-truncation=]
> >         snprintf(vhost_vring, 16, "vring_%d_size", i);
> >         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Since vring_num is 16 bits, the largest value ever would only be 17 bytes,
> > including the terminating nul.  Stretch it to 18 bytes (as a precaution
> > against a signed value, which again would never happen).
> 
> Looks like commit message is a bit outdated. Last sentence doesn't
> make sense in v2.
> 
> Other than that:
> Acked-by: Ilya Maximets <i.maximets at samsung.com>

Thanks, I applied this to master.


More information about the dev mailing list