Skip to content
Snippets Groups Projects
Commit aafbe1da authored by Heinrich Schuchardt's avatar Heinrich Schuchardt :speech_balloon: Committed by Tom Rini
Browse files

cmd: check argc for acpi dump


'acpi dump' without parameter results in a NULL dereference. Check the
number of arguments.

Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
parent eb09c330
No related branches found
No related tags found
No related merge requests found
...@@ -160,6 +160,9 @@ static int do_acpi_dump(struct cmd_tbl *cmdtp, int flag, int argc, ...@@ -160,6 +160,9 @@ static int do_acpi_dump(struct cmd_tbl *cmdtp, int flag, int argc,
char sig[ACPI_NAME_LEN]; char sig[ACPI_NAME_LEN];
int ret; int ret;
if (argc < 2)
return CMD_RET_USAGE;
name = argv[1]; name = argv[1];
if (strlen(name) != ACPI_NAME_LEN) { if (strlen(name) != ACPI_NAME_LEN) {
printf("Table name '%s' must be four characters\n", name); printf("Table name '%s' must be four characters\n", name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment