From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 9045237AA for ; Mon, 16 May 2016 12:05:48 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id a17so127661723wme.0 for ; Mon, 16 May 2016 03:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=+gR1OTe/FBO1N6CCc4/jBwyAsCkEZEsPF/jW5TEA4DM=; b=dOLUthHvwxYHJRThMPwK0fsKco25XFaSjo7pZNUP+vhrSnY50pcdb2iKIrcAVl5yn3 Z9x78dT2DFey81+pBQCdXdIk58efYvQ3ngsNxoEoCan0tYsGc9OpZtpNmceDcBQ/1aQq QjoCFUxx8IRnnTnmi6fZNW/tmFq8rI74aJ8+vY+G4TqOjFpiZ3jJ5vmeHgQJXkBXbWH+ LLECcJQzW076ITECLpOCTpXUmZHjQY4DB/EYMqJ+guIG9uydz11cegw7pr/RtkNdn4ES pbAEgaxf4S04YI8z8rb/l7DmYX7Gina+c8j+z3sZIGlbIF3ljKq0iqPLCNtWIlJxIWFR c9Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=+gR1OTe/FBO1N6CCc4/jBwyAsCkEZEsPF/jW5TEA4DM=; b=f5NvUIG8Q1zIXFv7Hztlu2LGeKNZYJi2jjhHwbpSb1Fi9LkpCltkouHduabsRD9RBQ ltZMBtY7ILEReG9rjCkXZcBcx5WbS3nBHl/Hp9nH5w+5KJtI+tOHuRjSb0EqTaSE9G0Q 0ouAHDCpOYY3WxotzL6w5nD6hE1sKbHqyWH1dryW6pCjCxiRXNx4KPnBIQ2iSSFMwpCf diy6X2LKk0sK/LXUl83YwoPetdfFR657LHlNHkRUCq40rrToN6PHtVlaeeEdTsnMEmgv UNLfxY/AwTHs4IgASwyRY33nTsepBPeYz/0SIuXdhRDek9AbbQX4WC774DUT+W2D8SGJ e87g== X-Gm-Message-State: AOPr4FXCkQs0uHJZcKaNt7QjN+MRiYtzsIwlu61okhbj2xp3W0EcRX/8UlCB0F1O0vfr+Tin X-Received: by 10.194.201.37 with SMTP id jx5mr28029232wjc.60.1463393148433; Mon, 16 May 2016 03:05:48 -0700 (PDT) Received: from xps13.localnet (232.202.154.77.rev.sfr.net. [77.154.202.232]) by smtp.gmail.com with ESMTPSA id cz3sm32889602wjb.14.2016.05.16.03.05.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2016 03:05:47 -0700 (PDT) From: Thomas Monjalon To: "Kobylinski, MichalX" Cc: dev@dpdk.org, "Dumitrescu, Cristian" Date: Mon, 16 May 2016 12:05:45 +0200 Message-ID: <1677876.8C2acBUBqJ@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126479A6F0C@IRSMSX108.ger.corp.intel.com> References: <1461321661-30272-1-git-send-email-michalx.kobylinski@intel.com> <3EB4FA525960D640B5BDFFD6A3D89126479A6F0C@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] cfgfile: fix integer overflow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 10:05:48 -0000 2016-04-28 11:09, Dumitrescu, Cristian: > From: Kobylinski, MichalX > > Fix issue reported by Coverity. > > > > Coverity ID 13289: Integer overflowed argument: The argument will be too > > small or even negative, likely resulting in unexpected behavior (for > > example, under-allocation in a memory allocation function). > > In rte_cfgfile_load: An integer overflow occurs, with the overflowed > > value used as an argument to a function > > > > Fixes: eaafbad419bf ("cfgfile: library to interpret config files") > > > > Signed-off-by: Michal Kobylinski > > I don't understand the root issue here, can you please explain? > > It looks to me that "end" is always going to point to a location bigger or equal to &buffer[1]. So the second parameter of _strip function is always going to be a positive number (0 included). Michal, any answer please?