summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorImran Zaman <imran.zaman@intel.com>2015-09-07 11:24:08 +0300
committerTom Rini <trini@konsulko.com>2015-09-15 15:04:53 -0400
commitca7def6003d376eb50547c468167e10cb5c2b835 (patch)
treec138d03e0bd7e99cfe9cb022fa598c5000dbbc2f /common
parentf458c8dac463d0a6037d4ecdbe59f07c4df34ad4 (diff)
downloadu-boot-imx-ca7def6003d376eb50547c468167e10cb5c2b835.zip
u-boot-imx-ca7def6003d376eb50547c468167e10cb5c2b835.tar.gz
u-boot-imx-ca7def6003d376eb50547c468167e10cb5c2b835.tar.bz2
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 <imran.zaman@intel.com>
Diffstat (limited to 'common')
-rw-r--r--common/cli_simple.c2
1 files changed, 1 insertions, 1 deletions
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;