[U-Boot] [U-Boot, 2/2] tools: mkenvimage: Fix possible segfault on stdin input

Tom Rini trini at konsulko.com
Sun Apr 29 21:04:31 UTC 2018


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 <ada at thorsis.com>

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: <http://lists.denx.de/pipermail/u-boot/attachments/20180429/8355e0b2/attachment.sig>


More information about the U-Boot mailing list