
19 Nov
2017
19 Nov
'17
11:07 p.m.
When copying the command line buffer the target array should at least have the same size.
Cf. definition of console_buffer in common/cli_readline.c.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- common/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/command.c b/common/command.c index e5d9b9cf95..21a6d409fb 100644 --- a/common/command.c +++ b/common/command.c @@ -318,7 +318,7 @@ static int find_common_prefix(char * const argv[]) return len; }
-static char tmp_buf[CONFIG_SYS_CBSIZE]; /* copy of console I/O buffer */ +static char tmp_buf[CONFIG_SYS_CBSIZE + 1]; /* copy of console I/O buffer */
int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp) {
--
2.15.0