summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-12-09 18:05:36 +0100
committerTom Rini <trini@konsulko.com>2023-12-13 18:39:06 -0500
commitaafbe1daa5b108635c6c20ae9f3b83db358e1827 (patch)
tree2505419aed6f2b4706837bc038a4d1d33c6b6d7c /cmd
parenteb09c33084ca2106fa669bee402abea4e6e437dd (diff)
downloadu-boot-aafbe1daa5b108635c6c20ae9f3b83db358e1827.tar.gz
u-boot-aafbe1daa5b108635c6c20ae9f3b83db358e1827.tar.bz2
u-boot-aafbe1daa5b108635c6c20ae9f3b83db358e1827.zip
cmd: check argc for acpi dump
'acpi dump' without parameter results in a NULL dereference. Check the number of arguments. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/acpi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/acpi.c b/cmd/acpi.c
index 89970417a0..0c14409242 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -160,6 +160,9 @@ static int do_acpi_dump(struct cmd_tbl *cmdtp, int flag, int argc,
char sig[ACPI_NAME_LEN];
int ret;
+ if (argc < 2)
+ return CMD_RET_USAGE;
+
name = argv[1];
if (strlen(name) != ACPI_NAME_LEN) {
printf("Table name '%s' must be four characters\n", name);