u-boot/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
..
binman tools: binman: Add missing filenames for various x86 rom tests 2017-04-10 10:02:03 +08:00
buildman buildman: Allow 'gnueabihf' toolchains for ARM 2017-04-18 10:29:19 -04:00
dtoc dtoc: Handle nodes with phandles that depend on the same 2017-05-10 13:37:21 -06:00
easylogo
env tools/env: avoid memory leak in fw_setenv 2017-04-18 10:29:22 -04:00
gdb
kermit
logos
omap
patman patman: Convert byte arrays to strings 2017-04-13 11:43:49 -06:00
scripts
tbot
.gitignore tools: sunxi: Add spl image builder 2017-04-07 11:23:45 +05:30
aisimage.c
aisimage.h
atmel_pmecc_params.c
atmelimage.c
bmp_logo.c
default_image.c
dumpimage.c
dumpimage.h
envcrc.c
fdt_host.h
fdtgrep.c fdtgrep: Cope with the /aliases node being last 2017-04-13 14:43:31 -06:00
fit_check_sign.c
fit_common.c
fit_common.h
fit_image.c
fit_info.c
gen_eth_addr.c
gen_ethaddr_crc.c tools: Add tool to add crc8 to a mac address 2017-02-07 10:54:33 -06:00
genboardscfg.py tools/genboardscfg.py: Make 'Supported' as known status 2017-05-12 08:37:36 -04:00
getline.c
getline.h
gpheader.h
gpimage-common.c
gpimage.c
ifdtool.c
ifdtool.h
image-host.c
imagetool.c
imagetool.h
img2brec.sh
img2srec.c
imximage.c tools: imximage: add set bit command 2017-03-19 17:30:15 +01:00
imximage.h tools: imximage: add set bit command 2017-03-19 17:30:15 +01:00
jtagconsole
kwbimage.c arm: mvebu: kwbimage: inline function to fix use-after-free 2017-05-31 07:43:04 +02:00
kwbimage.h
kwboot.c tools: kwboot: don't adjust destaddr when patching the image 2017-02-17 10:15:56 +01:00
lpc32xximage.c
Makefile tools: allow to override python 2017-04-13 14:44:49 -06:00
microcode-tool
microcode-tool.py
mingw_support.c
mingw_support.h
mkenvimage.c
mkexynosspl.c
mkimage.c
mkimage.h
mksunxiboot.c sunxi: Store the device tree name in the SPL header 2017-05-17 23:23:58 +05:30
moveconfig.py tools: moveconfig: cleanup README entires 2017-05-08 11:57:29 -04:00
mxsboot.c
mxsimage.c
mxsimage.h
ncb.c
netconsole
omapimage.c tools: omapimage: Fix size in header 2017-03-14 20:40:17 -04:00
omapimage.h
os_support.c
os_support.h
pbl_crc32.c
pbl_crc32.h
pblimage.c tools: plbimage support generate rcw file 2017-03-28 09:19:18 -07:00
pblimage.h
proftool.c
relocate-rela.c relocate-rela: add missing va_end() 2017-05-05 16:45:57 -04:00
rkcommon.c rockchip: mkimage: play nice with dumpimage 2017-05-10 13:37:21 -06:00
rkcommon.h rockchip: mkimage: rewrite padding calculation for SD/MMC and SPI images 2017-05-10 13:37:21 -06:00
rkimage.c rockchip: mkimage: remove placeholder functions from rkimage 2017-05-10 13:37:21 -06:00
rkmux.py
rksd.c rockchip: mkimage: rksd: pad SD/MMC images to a full blocksize 2017-05-10 13:37:21 -06:00
rkspi.c rockchip: mkimage: rewrite padding calculation for SD/MMC and SPI images 2017-05-10 13:37:21 -06:00
socfpgaimage.c
sunxi-spl-image-builder.c tools: sunxi: avoid read after end of string 2017-05-05 16:45:57 -04:00
ublimage.c
ublimage.h
ubsha1.c
vybridimage.c
xway-swap-bytes.c
zynqimage.c
zynqmpimage.c