mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
efi_loader: catch misspelled bootefi subcommand
If 'bootefi hello' or 'bootefi selftest' can be executed depends on the configuration. If an invalid non-numeric 1st argument is passed to bootefi, e.g. 'bootefi hola', this string is converted to 0 and U-Boot jumps to this typically invalid address. With the patch the online help is shown instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
c6fa5df6aa
commit
49db1cb8c3
1 changed files with 3 additions and 0 deletions
|
@ -373,6 +373,9 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
saddr = argv[1];
|
||||
|
||||
addr = simple_strtoul(saddr, NULL, 16);
|
||||
/* Check that a numeric value was passed */
|
||||
if (!addr && *saddr != '0')
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc > 2) {
|
||||
sfdt = argv[2];
|
||||
|
|
Loading…
Reference in a new issue