From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sat, 6 May 2017 21:28:09 -0400 Subject: [U-Boot] [U-Boot, v2, 1/1] tools: sunxi: avoid read after end of string In-Reply-To: <20170504202642.5031-1-xypron.glpk@gmx.de> References: <20170504202642.5031-1-xypron.glpk@gmx.de> Message-ID: <20170507012809.GA12511@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, May 04, 2017 at 10:26:42PM +0200, xypron.glpk at gmx.de wrote: > The evaluation of option -c is incorrect: > > According to the C99 standard endptr in the first strtol is always > set as &endptr is not NULL. > So the first part of the or condition is always true. > If all digits in optarg are valid endptr will point to the closing \0 > and the second strtol will read beyond the end of the string optarg > points to. > > Signed-off-by: Heinrich Schuchardt > Acked-by: Boris Brezillon Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: