diff options
| author | Imran Zaman <[email protected]> | 2015-09-07 11:24:08 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2015-09-15 15:04:53 -0400 |
| commit | ca7def6003d376eb50547c468167e10cb5c2b835 (patch) | |
| tree | c138d03e0bd7e99cfe9cb022fa598c5000dbbc2f /common/cli_simple.c | |
| parent | f458c8dac463d0a6037d4ecdbe59f07c4df34ad4 (diff) | |
cli_simple.c: fix possible overflow when copying the string
Bigger source buffer than dest buffer could overflow when copying
strings. Source and destination buffer sizes are same now.
Signed-off-by: Imran Zaman <[email protected]>
Diffstat (limited to 'common/cli_simple.c')
| -rw-r--r-- | common/cli_simple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cli_simple.c b/common/cli_simple.c index 00a8d2f48b3..d8b40c93915 100644 --- a/common/cli_simple.c +++ b/common/cli_simple.c @@ -258,7 +258,7 @@ int cli_simple_run_command(const char *cmd, int flag) void cli_simple_loop(void) { - static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, }; + static char lastcommand[CONFIG_SYS_CBSIZE + 1] = { 0, }; int len; int flag; |
