1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-04 18:22:02 +02:00
Files
u-boot-megous/tools
Patrick Wildt 6cbf7eda3c arm: mvebu: kwbimage: inline function to fix use-after-free
image_version_file()'s only use is to return the version number of the
specified image, and it's only called by kwbimage_generate().  This
version function mallocs "image_cfg" and reads the contents of the image
into that buffer.  Before return to its caller it frees the buffer.

After extracting the version, kwb_image_generate() tries to calculate
the header size by calling image_headersz_v1().  This function now
accesses "image_cfg", which has already been freed.

Since image_version_file() is only used by a single function, inline it
into kwbimage_generate() and only free the buffer after it is no longer
needed.  This also improves code readability since the code is mostly
equal to kwbimage_set_header().

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Stefan Roese <sr@denx.de>
2017-05-31 07:43:04 +02:00
..
2017-04-07 11:23:45 +05:30
2016-05-02 18:37:09 -04:00
2016-05-02 18:37:09 -04:00
2016-11-23 23:41:23 -08:00
2017-02-01 09:04:18 +01:00
2017-04-13 14:44:49 -06:00
2016-02-21 11:09:19 +01:00
2015-11-16 17:22:18 -05:00