projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb09c33
)
cmd: check argc for acpi dump
author
Heinrich Schuchardt
<heinrich.schuchardt@canonical.com>
Sat, 9 Dec 2023 17:05:36 +0000
(18:05 +0100)
committer
Tom Rini
<trini@konsulko.com>
Wed, 13 Dec 2023 23:39:06 +0000
(18:39 -0500)
'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>
cmd/acpi.c
patch
|
blob
|
history
diff --git
a/cmd/acpi.c
b/cmd/acpi.c
index 89970417a0285461738ed2def5baa131d16c0b0e..0c144092420eae705aa1f2fc932df6418215901c 100644
(file)
--- 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);