From: Imran Zaman Date: Mon, 7 Sep 2015 08:24:08 +0000 (+0300) Subject: cli_simple.c: fix possible overflow when copying the string X-Git-Tag: v2015.10-rc4~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca7def6003d376eb50547c468167e10cb5c2b835;p=platform%2Fkernel%2Fu-boot.git 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 --- diff --git a/common/cli_simple.c b/common/cli_simple.c index 00a8d2f..d8b40c9 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;