protos: chainload: Allocate memory for the null terminator in cmdline
This commit is contained in:
parent
7305724b95
commit
e53acb997a
@ -242,7 +242,7 @@ noreturn void efi_chainload_file(char *config, char *cmdline, struct file_handle
|
||||
|
||||
size_t cmdline_len = strlen(cmdline);
|
||||
CHAR16 *new_cmdline;
|
||||
status = gBS->AllocatePool(EfiLoaderData, cmdline_len * sizeof(CHAR16), (void **)&new_cmdline);
|
||||
status = gBS->AllocatePool(EfiLoaderData, (cmdline_len + 1) * sizeof(CHAR16), (void **)&new_cmdline);
|
||||
if (status) {
|
||||
panic(true, "chainload: Allocation failure");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user