]> git.ipfire.org Git - thirdparty/u-boot.git/commit
cmd: elf: Prevent possible buffer overflow
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 21 Jul 2025 14:43:36 +0000 (15:43 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 28 Jul 2025 19:04:42 +0000 (13:04 -0600)
commitb83f865e75aecf7edbc75c3794b3e29ef5bff5a2
tree29cdec3257ed1aff8a48fd7069e46da6bbdbd68f
parent9b2e79419024a8d3435b6a1e82ea92c934d5b89b
cmd: elf: Prevent possible buffer overflow

In do_bootvx the environment variable 'bootdev' is fetched and copied
into a buffer without confirming that it will not overflow that buffer.
Use strlcpy to ensure that the buffer will not be overflowed.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
cmd/elf.c