From: Tom Rini Date: Sun, 29 Apr 2018 17:04:31 -0400 Subject: [U-Boot] [U-Boot, 2/2] tools: mkenvimage: Fix possible segfault on stdin input In-Reply-To: <20180420132931.22250-3-ada@thorsis.com> References: <20180420132931.22250-3-ada@thorsis.com> Message-ID: <20180429210431.GJ31362@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Apr 20, 2018 at 03:29:31PM +0200, Alexander Dahl wrote: > The size of 'filebuf' was not increased as more and more bytes are read > from stdin, but 'filebuf' was always reallocated to the same fix size. > This works as long as only less bytes than the initial buffer size come > in, for more input this will segfault. (It actually does, I tested > that.) So for each loop cycle the buffer size has to be increased by the > number of bytes we want to read. > > Signed-off-by: Alexander Dahl 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: not available URL: