diff options
author | Ingo Molnar <mingo@kernel.org> | 2020-10-12 14:38:31 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-10-12 14:38:31 +0300 |
commit | 4d0a4388ccdd9482fef6b26f879d0f6099143f80 (patch) | |
tree | b711a02c0cf93d50ac206511e879b4d3521d12b7 /drivers/firmware/efi/libstub/efi-stub-helper.c | |
parent | cc383a9e245c527d3175e2cf4cced9dbbedbbac6 (diff) | |
parent | d32de9130f6c79533508e2c7879f18997bfbe2a0 (diff) | |
download | linux-4d0a4388ccdd9482fef6b26f879d0f6099143f80.tar.xz |
Merge branch 'efi/urgent' into efi/core, to pick up fixes
These fixes missed the v5.9 merge window, pick them up for early v5.10 merge.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efi-stub-helper.c')
-rw-r--r-- | drivers/firmware/efi/libstub/efi-stub-helper.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index 4dbf04cc8930..aa8da0a49829 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -187,20 +187,28 @@ int efi_printk(const char *fmt, ...) */ efi_status_t efi_parse_options(char const *cmdline) { - size_t len = strlen(cmdline) + 1; + size_t len; efi_status_t status; char *str, *buf; + if (!cmdline) + return EFI_SUCCESS; + + len = strnlen(cmdline, COMMAND_LINE_SIZE - 1) + 1; status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, len, (void **)&buf); if (status != EFI_SUCCESS) return status; - str = skip_spaces(memcpy(buf, cmdline, len)); + memcpy(buf, cmdline, len - 1); + buf[len - 1] = '\0'; + str = skip_spaces(buf); while (*str) { char *param, *val; str = next_arg(str, ¶m, &val); + if (!val && !strcmp(param, "--")) + break; if (!strcmp(param, "nokaslr")) { efi_nokaslr = true; |