efivars: add missing OOM check
authorLennart Poettering <lennart@poettering.net>
Fri, 12 Oct 2018 16:50:46 +0000 (18:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 13 Oct 2018 10:37:13 +0000 (12:37 +0200)
CID #1395833

src/shared/efivars.c

index da70e68..7a97540 100644 (file)
@@ -455,6 +455,9 @@ int efi_get_boot_option(
                         /* Sub-Type 4 – File Path */
                         if (dpath->sub_type == MEDIA_FILEPATH_DP && !p && path) {
                                 p = utf16_to_utf8(dpath->path, dpath->length-4);
+                                if (!p)
+                                        return  -ENOMEM;
+
                                 efi_tilt_backslashes(p);
                                 continue;
                         }