Don't pass a pointer-to-(LoadedImage *) as a void **;

pass in a real void pointer's address and cast it reasonably.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
This commit is contained in:
Nigel Croxon 2016-03-03 16:24:31 -05:00
parent 1ecae7d44c
commit 087d22af38

View File

@ -31,7 +31,7 @@ GetShellArgcArgvFromLoadedImage(
)
{
EFI_STATUS Status;
EFI_LOADED_IMAGE *LoadedImage = NULL;
void *LoadedImage = NULL;
static CHAR16 ArgvContents[MAX_CMDLINE_SIZE];
static CHAR16 *Argv[MAX_CMDLINE_ARGC], *ArgStart, *c;
UINTN Argc = 0, BufLen;
@ -47,13 +47,13 @@ GetShellArgcArgvFromLoadedImage(
if (EFI_ERROR(Status))
return -1;
BufLen = LoadedImage->LoadOptionsSize;
BufLen = ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptionsSize;
if (BufLen < 2) /* We are expecting at least a \0 */
return -1;
else if (BufLen > sizeof(ArgvContents))
BufLen = sizeof(ArgvContents);
CopyMem(ArgvContents, LoadedImage->LoadOptions, BufLen);
CopyMem(ArgvContents, ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptions, BufLen);
ArgvContents[MAX_CMDLINE_SIZE - 1] = L'\0';
for (c = ArgStart = ArgvContents ; *c != L'\0' ; ++c) {