From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id CC0111DB8 for ; Wed, 18 Jul 2018 10:42:39 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id 69-v6so1950440wmf.3 for ; Wed, 18 Jul 2018 01:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6dKr9E2BYJp94LfQg8BUFrB9ew/z+QsaxWW0NfeA6SA=; b=FmBk7vw5K5yV7kJ1T7XAn87oCJyrnacnUqSiONkCr0+qF5wTDpiAa9/nw/HG/qH4xJ sj8zjvtNKPI3k4RxO9uOf0y5PimUz2jKQFZ/LWjZGQ8AibFEfikYW2oD+8BF03/a2hgX qDQ34ETxlOgBsbGcUs49k3uhnECrhaCZcWUOUB402M+0YRhUGSzcFH9AtbDmvQduS6cN vwRhLe8mdR6frvNgsL2VwpYeIKiNFSiZH1LGxcS8FetjM/5RBclmifgEJyOEih/i45VT B+lPpZ+WONE3yvkVu5LTj71NsVyOX9Ev5k+si2BshYuUFW+mzAnUNqqCO3R3lTAY/fDv sbqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=6dKr9E2BYJp94LfQg8BUFrB9ew/z+QsaxWW0NfeA6SA=; b=b5tvlOk2zW3lnBKnj6LLKIogmA4BBNZd4T/0wJFyOkHIzMop2YQ0v2pb9R6XEYqxyZ lKKv/Kn8AxlbIIz4fUQv1CpLrwZv9i8gGjLgZnjM9iDrplhwjPZu+cGhKD3hv+HQWrrQ PpNm842rglRgC21Hid0oADaashdy562ggsalRFNxpKGPIUOVhpam+7+eBBWNGo9o6+EX p9QoJ0UyMl0UQz65YtJrbtvUB8VxpaCeHBRQ2QxKKm5zDS1kEcCmwfwSc2AIK50nE8xJ d1SOTiMlBkDC55wciyuSZlVxyVzeZFnL9HBXXNVPqGM6L3jQJmrenT2ynGNDnYDzUbaP M/GA== X-Gm-Message-State: AOUpUlGdGefTpXPkEjS4YEatDbhHk2YldFujoO+ln9rnh5RjtCY+zF/2 r1xGSGN1tEyYRzQ8AzrwNvgwSy1O X-Google-Smtp-Source: AAOMgpclLdbwg5MgAIMx/dKomiVF0/G06WQJz77YLmKAyvjPHEXuNZdPsDnMNTKvWHwvzYAKHfTLjA== X-Received: by 2002:a1c:ed4:: with SMTP id 203-v6mr1015959wmo.96.1531903359402; Wed, 18 Jul 2018 01:42:39 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id y14-v6sm8487717wrq.45.2018.07.18.01.42.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jul 2018 01:42:38 -0700 (PDT) Date: Wed, 18 Jul 2018 10:42:22 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Andrew Rybchenko Cc: dev@dpdk.org Message-ID: <20180718084221.kbryl4ej5rmdioom@bidouze.vm.6wind.com> References: <1531898610-19654-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1531898610-19654-1-git-send-email-arybchenko@solarflare.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] devargs: fix devargs truncation when format string is used X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 08:42:39 -0000 Hi, On Wed, Jul 18, 2018 at 08:23:30AM +0100, Andrew Rybchenko wrote: > Space for string terminating NUL character should be provided to > snprintf() to avoid the last symbol truncation. > > Fixes: a23bc2c4e01b ("devargs: add non-variadic parsing function") > > Reported-by: Ivan Malov > Signed-off-by: Andrew Rybchenko Acked-by: Gaetan Rivet > --- > lib/librte_eal/common/eal_common_devargs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c > index a22a2002e..5ec688aab 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -285,7 +285,7 @@ rte_devargs_parsef(struct rte_devargs *da, const char *format, ...) > } > > va_start(ap, format); > - vsnprintf(dev, len, format, ap); > + vsnprintf(dev, len + 1, format, ap); Indeed, thanks for reporting and fixing. > va_end(ap); > > return rte_devargs_parse(da, dev); > -- > 2.17.1 > -- Gaëtan Rivet 6WIND