Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Kristian Otnes's avatar
    5c50a92b
    hush shell: Avoid string write overflow when entering max cmd length · 5c50a92b
    Kristian Otnes authored
    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>
    5c50a92b
    History
    hush shell: Avoid string write overflow when entering max cmd length
    Kristian Otnes authored
    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>