[dpdk-stable] [dpdk-dev] [PATCH 1/5] net/bonding: fix buffer length when printing strings
Stephen Hemminger
stephen at networkplumber.org
Wed Apr 3 17:53:41 CEST 2019
On Wed, 3 Apr 2019 16:51:17 +0100
Bruce Richardson <bruce.richardson at intel.com> wrote:
> On Wed, Apr 03, 2019 at 08:47:58AM -0700, Stephen Hemminger wrote:
> > On Wed, 3 Apr 2019 15:45:01 +0100
> > Bruce Richardson <bruce.richardson at intel.com> wrote:
> >
> > >
> > > static void
> > > -arp_op_name(uint16_t arp_op, char *buf)
> > > +arp_op_name(uint16_t arp_op, char *buf, size_t buf_len)
> > > {
> > > switch (arp_op) {
> > > case ARP_OP_REQUEST:
> > > - snprintf(buf, sizeof("ARP Request"), "%s", "ARP Request");
> > > + snprintf(buf, buf_len, "%s", "ARP Request");
> > > return;
> > This should be strlcpy not snprintf
>
> Yes, it should, but I just let that get fixed by cocci script in the later
> patch. For this one, I just fixed the most egregious error.
Ok, I see
More information about the stable
mailing list