From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] cfgfile: fix uninitialized variable on load error Date: Tue, 14 Feb 2017 18:14:27 +0100 Message-ID: <2924499.9xLPenM5g3@xps13> References: <1486435866-30562-1-git-send-email-bombermag@gmail.com> <3EB4FA525960D640B5BDFFD6A3D891265274CEFD@IRSMSX108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Dumitrescu, Cristian" To: Dmitriy Yakovlev Return-path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id 884181077 for ; Tue, 14 Feb 2017 18:14:29 +0100 (CET) Received: by mail-wr0-f169.google.com with SMTP id c4so16776859wrd.2 for ; Tue, 14 Feb 2017 09:14:29 -0800 (PST) In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891265274CEFD@IRSMSX108.ger.corp.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" > > Uninitialized scalar variable. Using uninitialized value cfg- > > >sections[curr_section]->num_entries when calling rte_cfgfile_close. > > And memory in variables cfg->sections[curr_section], sect- > > >entries[curr_entry] maybe not equal NULL. We must decrement counters > > curr_section, curr_entry when failed to realloc. > > > > Fixes: eaafbad419bf ("cfgfile: library to interpret config files") > > > > Signed-off-by: Dmitriy Yakovlev > > --- > > lib/librte_cfgfile/rte_cfgfile.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > Acked-by: Cristian Dumitrescu Applied, thanks