Commit 0ece6b50f153fe2d349f4d26b18de4b0a3273537

Authored by Tuomas Tynkkynen
Committed by Tom Rini
1 parent 445614cc2f

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1648,7 +1648,7 @@
1648 1648  
1649 1649 is_pxe = false;
1650 1650  
1651   - if (strstr(argv[1], "-p")) {
  1651 + if (argc > 1 && strstr(argv[1], "-p")) {
1652 1652 prompt = 1;
1653 1653 argc--;
1654 1654 argv++;