]> git.baikalelectronics.ru Git - uboot.git/commit
lib/display_options: avoid illegal memory access
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 26 Apr 2019 16:39:00 +0000 (18:39 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 5 May 2019 12:48:50 +0000 (08:48 -0400)
commit2f983af1750b04b0ea6499d37efef0b1558ed688
tree3ee2fcf5eba59f4d75f642e96c8f7f7a11bebc36
parent214b18313faa359dbb5faaa3851a240551370cbb
lib/display_options: avoid illegal memory access

display_options_get_banner_priv() overwrites bytes before the start of the
buffer if the buffer size is less then 3. This case occurs in the Sandbox
when executing the `ut_print` command.

Correctly handle small buffer sizes. Adjust the print unit test to catch
when bytes before the buffer are overwritten.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/display_options.c
test/print_ut.c