From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 1/5] net/bonding: fix buffer length when printing strings Date: Wed, 3 Apr 2019 16:51:17 +0100 Message-ID: <20190403155117.GA1332@bricha3-MOBL.ger.corp.intel.com> References: <20190403144505.46234-1-bruce.richardson@intel.com> <20190403144505.46234-2-bruce.richardson@intel.com> <20190403084758.2b7bed7f@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Declan Doherty , stable@dpdk.org To: Stephen Hemminger Return-path: Content-Disposition: inline In-Reply-To: <20190403084758.2b7bed7f@shemminger-XPS-13-9360> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Apr 03, 2019 at 08:47:58AM -0700, Stephen Hemminger wrote: > On Wed, 3 Apr 2019 15:45:01 +0100 > Bruce Richardson 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.