From: Tuomas Tynkkynen Date: Thu, 7 May 2015 18:29:18 +0000 (+0300) Subject: pxe: Fix crash if 'sysboot' is run without args X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=0ece6b50f153fe2d349f4d26b18de4b0a3273537;p=u-boot.git pxe: Fix crash if 'sysboot' is run without args Previously, a NULL pointer dereference would occur if the 'sysboot' command is executed without any arguments. Signed-off-by: Tuomas Tynkkynen Reviewed-by: Simon Glass --- diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 4cbb2b1173..abf0941b57 100644 --- a/common/cmd_pxe.c +++ b/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++;