From b6d91ca8936616a9e0a7d01f7a18d366d496902c Mon Sep 17 00:00:00 2001 From: marcel Date: Sat, 1 Mar 2003 05:13:59 +0000 Subject: Paranoia: Don't use the length of the option string alone to determine whether we have command line options. We expect a valid string pointer as well. --- sys/boot/efi/libefi/libefi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot') diff --git a/sys/boot/efi/libefi/libefi.c b/sys/boot/efi/libefi/libefi.c index 5ef97f4..abfa6a8 100644 --- a/sys/boot/efi/libefi/libefi.c +++ b/sys/boot/efi/libefi/libefi.c @@ -120,7 +120,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) * If the string is already in Unicode-16, we make a copy so that * we know we can always modify the string. */ - if (img->LoadOptionsSize) { + if (img->LoadOptionsSize > 0 && img->LoadOptions != NULL) { if (img->LoadOptionsSize == strlen(img->LoadOptions) + 1) { args = malloc(img->LoadOptionsSize << 1); for (argc = 0; argc < img->LoadOptionsSize; argc++) -- cgit v1.1