summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-01-24 20:33:54 +0100
committerAlexander Graf <agraf@suse.de>2018-01-28 21:37:13 +0100
commit49db1cb8c3a2cfaf3cd9d01b630382843e29c48d (patch)
treeb97154396318959a5416768da9d3d473b3a22235 /cmd
parentc6fa5df6aab48b12803ea9634b7f7becdc90810d (diff)
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>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bootefi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 545cfecc12..4233d36b72 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -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];