diff options
author | Tuomas Tynkkynen | 2015-05-07 21:29:18 +0300 |
---|---|---|
committer | Tom Rini | 2015-05-27 13:35:48 -0400 |
commit | 0ece6b50f153fe2d349f4d26b18de4b0a3273537 (patch) | |
tree | f717babba339a9dda9d3af42badee2f2ad229d25 | |
parent | 445614cc2fbbbdb2be32663b7ba0927ac99cb353 (diff) |
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 <tuomas.tynkkynen@iki.fi>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/cmd_pxe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 4cbb2b11734..abf0941b579 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++; |