efi: make sure parse_boolean() does something useful on a NULL parameter

This commit is contained in:
Lennart Poettering 2018-10-22 16:45:32 +02:00
parent 427ee7ec82
commit 95a18e91db

View File

@ -60,6 +60,9 @@ UINT64 time_usec(VOID) {
}
EFI_STATUS parse_boolean(const CHAR8 *v, BOOLEAN *b) {
if (!v)
return EFI_INVALID_PARAMETER;
if (strcmpa(v, (CHAR8 *)"1") == 0 ||
strcmpa(v, (CHAR8 *)"yes") == 0 ||
strcmpa(v, (CHAR8 *)"y") == 0 ||