Skip to contentSkip to conversation

fix: possible overflow when copying the string

PATCH New Imran Zaman 2 participants 2 messages Sep 7, 2015 – Sep 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 common/cli_simple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/cli_simple.c +1 -1
index 00a8d2f..d8b40c9 100644
@@ -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;
Signature · 12 lines
1.9.1

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
#1 lore raw

PATCH 1/1 fix: possible overflow when copying the string

Quoted 5 lines · Imran Zaman

Bigger source buffer than dest buffer could
overflow when copying strings.
Source and destination buffer sizes are same now.

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: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150915/cde46ec9/attachment.sig>