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.
This commit is contained in:
Marcel Moolenaar 2003-03-01 05:13:59 +00:00
parent 9e2e96d803
commit 884d549049
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111692

View File

@ -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++)