From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 1/5] net/bonding: fix buffer length when printing strings Date: Wed, 3 Apr 2019 08:47:58 -0700 Message-ID: <20190403084758.2b7bed7f@shemminger-XPS-13-9360> References: <20190403144505.46234-1-bruce.richardson@intel.com> <20190403144505.46234-2-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Declan Doherty , stable@dpdk.org To: Bruce Richardson Return-path: Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 77A8B1B4A2 for ; Wed, 3 Apr 2019 17:48:02 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id t21so8360046pfe.2 for ; Wed, 03 Apr 2019 08:48:02 -0700 (PDT) In-Reply-To: <20190403144505.46234-2-bruce.richardson@intel.com> 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, 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