]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efivars: don't crash when somebody wants to remove an efi variable 6780/head
authorLennart Poettering <lennart@poettering.net>
Fri, 8 Sep 2017 15:34:11 +0000 (17:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 8 Sep 2017 15:34:11 +0000 (17:34 +0200)
This corrects b3c908b4a230c5cca0dcdd7e94d02ec54a298abf by allowing a
NULL value again for variable deletion.

Fixes: #6753
src/shared/efivars.c

index 8229e6b1834402b4cbfe6026eb30cda4640935c1..2503346610eaf94329f13161a485a331522b1b97 100644 (file)
@@ -269,7 +269,7 @@ int efi_set_variable(
         _cleanup_close_ int fd = -1;
 
         assert(name);
-        assert(value);
+        assert(value || size == 0);
 
         if (asprintf(&p,
                      "/sys/firmware/efi/efivars/%s-%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",