]> git.dujemihanovic.xyz Git - u-boot.git/commit
hush shell: Avoid string write overflow when entering max cmd length
authorKristian Otnes <kotnes@cisco.com>
Fri, 25 Apr 2014 13:35:43 +0000 (15:35 +0200)
committerTom Rini <trini@ti.com>
Mon, 12 May 2014 19:20:05 +0000 (15:20 -0400)
commit5c50a92bbea7e118ea4e4fb0945bf6707b010a80
tree034a76d7fe3a7e183aba9ba9fd3c518e9fa21fef
parentbf69d6642326cfecef440bb245946903454ff30e
hush shell: Avoid string write overflow when entering max cmd length

console_buffer array is defined to be CONFIG_SYS_CBSIZE + 1 long,
whereas the_command array only CONFIG_SYS_CBSIZE long. Subsequent
use of strcpy(the_command, console_buffer) will write final \0
terminating byte outside the_command array when entering a command
of max length.

Signed-off-by: Kristian Otnes <kotnes <at> cisco <dot> com>
common/hush.c