[U-Boot] [PATCH 1/2] pxe: Fix crash if 'sysboot' is run without args

Tuomas Tynkkynen tuomas.tynkkynen at iki.fi
Thu May 7 20:29:18 CEST 2015


Previously, a NULL pointer dereference would occur if the 'sysboot'
command is executed without any arguments.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
---
 common/cmd_pxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git common/cmd_pxe.c common/cmd_pxe.c
index 4cbb2b1..abf0941 100644
--- common/cmd_pxe.c
+++ common/cmd_pxe.c
@@ -1648,7 +1648,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	is_pxe = false;
 
-	if (strstr(argv[1], "-p")) {
+	if (argc > 1 && strstr(argv[1], "-p")) {
 		prompt = 1;
 		argc--;
 		argv++;
-- 
2.4.0



More information about the U-Boot mailing list