Skip to contentSkip to conversation

common: command: tempory buffer should have size of command line buf

PATCH New Heinrich Schuchardt 2 participants 2 messages Nov 19, 2017 – Nov 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: command: tempory buffer should have size of command line buf

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.

---
 common/command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/command.c +1 -1
index e5d9b9cf95..21a6d409fb 100644
@@ -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)
 {
Signature · 1 line
2.15.0
#1 lore raw

PATCH 1/1 common: command: tempory buffer should have size of command line buf

Quoted 6 lines · Heinrich Schuchardt

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171130/9893453e/attachment.sig>