diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2020-02-28 09:05:04 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-03-11 08:23:05 +0100 |
commit | e8bced62b6be344dbc922d88b1b278e316e1585f (patch) | |
tree | 8e7d746fd7b2ca998191f470f815d252751a7b13 | |
parent | b484296f6fda23ab2c996892826ebcc12cbd2303 (diff) |
cmd: efidebug: fix a failure of "boot rm" sub-command
There is a wrong usage of utf8_utf16_strncpy() in "boot rm" command, and
then it will end up with a failure of this command due to a wrong
value of an interim variable ("var_name16").
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r-- | cmd/efidebug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 21dfd44fcc..056ebb1083 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -649,7 +649,7 @@ static int do_efi_boot_rm(cmd_tbl_t *cmdtp, int flag, int id, i; char *endp; char var_name[9]; - u16 var_name16[9]; + u16 var_name16[9], *p; efi_status_t ret; if (argc == 1) @@ -662,7 +662,8 @@ static int do_efi_boot_rm(cmd_tbl_t *cmdtp, int flag, return CMD_RET_FAILURE; sprintf(var_name, "Boot%04X", id); - utf8_utf16_strncpy((u16 **)&var_name16, var_name, 9); + p = var_name16; + utf8_utf16_strncpy(&p, var_name, 9); ret = EFI_CALL(RT->set_variable(var_name16, &guid, 0, 0, NULL)); if (ret) { |