From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal: fix off-by-one error in hotplug add Date: Fri, 04 Aug 2017 18:12:02 +0200 Message-ID: <5052998.tBGEROTkJq@xps> References: <1501860623-16747-1-git-send-email-gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Gaetan Rivet Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 0AFFF235 for ; Fri, 4 Aug 2017 18:12:04 +0200 (CEST) In-Reply-To: <1501860623-16747-1-git-send-email-gaetan.rivet@6wind.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" 04/08/2017 17:30, Gaetan Rivet: > snprintf returns the length it would have written had the given length > been enough, *terminating null byte excluded*. > > It will however limit the length of its writing to given length minus > one, and always put a terminating null-byte at the end of the string. > > This must be taken into account when calculating the total length of the > device declaration string. > > Fixes: 3054036f054a ("eal: fix possible crash in hotplug") > > Signed-off-by: Gaetan Rivet > --- > > Charybdis -> Scylla Oiseau de mauvais augure :) The best is the enemy of the good. Applied, thanks