1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00

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 ||