提交 0ece6b50 编写于 作者: T Tuomas Tynkkynen 提交者: Tom Rini

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: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 445614cc
...@@ -1648,7 +1648,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -1648,7 +1648,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
is_pxe = false; is_pxe = false;
if (strstr(argv[1], "-p")) { if (argc > 1 && strstr(argv[1], "-p")) {
prompt = 1; prompt = 1;
argc--; argc--;
argv++; argv++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册