cmd_mtdparts.c: prevent printbuffer overflows
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>
This commit is contained in:
parent
3920bbedcf
commit
a693447cea
|
@ -1254,8 +1254,14 @@ static void list_partitions(void)
|
||||||
printf("\ndefaults:\n");
|
printf("\ndefaults:\n");
|
||||||
printf("mtdids : %s\n",
|
printf("mtdids : %s\n",
|
||||||
mtdids_default ? mtdids_default : "none");
|
mtdids_default ? mtdids_default : "none");
|
||||||
printf("mtdparts: %s\n",
|
/*
|
||||||
mtdparts_default ? mtdparts_default : "none");
|
* Using printf() here results in printbuffer overflow
|
||||||
|
* if default mtdparts string is greater than console
|
||||||
|
* printbuffer. Use puts() to prevent system crashes.
|
||||||
|
*/
|
||||||
|
puts("mtdparts: ");
|
||||||
|
puts(mtdparts_default ? mtdparts_default : "none");
|
||||||
|
puts("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue