summaryrefslogtreecommitdiff
path: root/include/libfdt_env.h
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@blueri.se>2017-05-10 20:18:54 (GMT)
committerStefan Roese <sr@denx.de>2017-05-31 05:43:04 (GMT)
commit6cbf7eda3cbe0f8cbaa84b4daaa86dfa2a696a77 (patch)
tree76eaed955cbd27a43f46ec70d805b5f886336ae4 /include/libfdt_env.h
parentf3d9ec2a6926bd436f15298ab9cebab061ab159a (diff)
downloadu-boot-6cbf7eda3cbe0f8cbaa84b4daaa86dfa2a696a77.tar.xz
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>
Diffstat (limited to 'include/libfdt_env.h')
0 files changed, 0 insertions, 0 deletions