From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8A4F41077 for ; Tue, 14 Feb 2017 17:47:47 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 08:47:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,162,1484035200"; d="scan'208";a="933801401" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga003.jf.intel.com with ESMTP; 14 Feb 2017 08:47:44 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX154.ger.corp.intel.com ([169.254.12.40]) with mapi id 14.03.0248.002; Tue, 14 Feb 2017 16:46:48 +0000 From: "Dumitrescu, Cristian" To: Dmitriy Yakovlev , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] cfgfile: fix uninitialized variable on load error Thread-Index: AQHSgO0yogjMlIdnm0Og1DHoiUg5BKFowdUg Date: Tue, 14 Feb 2017 16:46:47 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891265274CEFD@IRSMSX108.ger.corp.intel.com> References: <1486435866-30562-1-git-send-email-bombermag@gmail.com> In-Reply-To: <1486435866-30562-1-git-send-email-bombermag@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzBiNWRhNmEtNGI0Ny00MjNlLTkxNzUtNDNjYTM4NmQ3NTkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJWT0loVFBTcDNoRGY1aHl0aUlraXJKcVo4TjNOUzdPdkg2UGQrazZ6QWpBPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] cfgfile: fix uninitialized variable on load error 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: Tue, 14 Feb 2017 16:47:48 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Dmitriy Yakovlev > Sent: Tuesday, February 7, 2017 2:51 AM > To: dev@dpdk.org > Cc: Dmitriy Yakovlev > Subject: [dpdk-dev] [PATCH] cfgfile: fix uninitialized variable on load e= rror >=20 > 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. >=20 > Fixes: eaafbad419bf ("cfgfile: library to interpret config files") >=20 > Signed-off-by: Dmitriy Yakovlev > --- > lib/librte_cfgfile/rte_cfgfile.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 Acked-by: Cristian Dumitrescu