public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] cmd_mtdparts.c: prevent printbuffer overflows
@ 2010-02-23 15:18 Anatolij Gustschin
  2010-02-23 15:24 ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Anatolij Gustschin @ 2010-02-23 15:18 UTC (permalink / raw)
  To: u-boot

The length of configured MTDPARTS_DEFAULT string
could be greater than console printbuffer size.
Replace printf() by puts() to avoid potential buffer
overflows.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
Changes since v1:
 - use puts() instead of printf() as suggested by Wolfgang.

 common/cmd_mtdparts.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index b375fea..0fd5ce2 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -1254,8 +1254,9 @@ static void list_partitions(void)
 	printf("\ndefaults:\n");
 	printf("mtdids  : %s\n",
 		mtdids_default ? mtdids_default : "none");
-	printf("mtdparts: %s\n",
-		mtdparts_default ? mtdparts_default : "none");
+	puts("mtdparts: ");
+	puts(mtdparts_default ? mtdparts_default : "none");
+	puts("\n");
 }
 
 /**
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-23 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23 15:18 [U-Boot] [PATCH v2] cmd_mtdparts.c: prevent printbuffer overflows Anatolij Gustschin
2010-02-23 15:24 ` Stefan Roese
2010-02-23 22:51   ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox