summaryrefslogtreecommitdiff
path: root/fallback.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2021-08-29 18:46:37 +0200
committerRobbie Harwood <rharwood@redhat.com>2021-09-03 09:46:30 -0400
commitc5784078a9078c0c2171aa42b458f34b2b175c74 (patch)
treea7d40b9f6ac6c69bde242fffcd2735aeb21a5109 /fallback.c
parent204f6bb5ba94061c8d0c60a6969fb263aadfce2d (diff)
downloadefi-boot-shim-c5784078a9078c0c2171aa42b458f34b2b175c74.tar.gz
efi-boot-shim-c5784078a9078c0c2171aa42b458f34b2b175c74.zip
fallback: incorrect check after AllocateZeroPool()
After calling AllocateZeroPool() we must check the returned pointer. Fixes: 3ce517fdbb4e ("Add a fallback loader for when shim is invoked as BOOTX64.EFI") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'fallback.c')
-rw-r--r--fallback.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fallback.c b/fallback.c
index 87fc3c80..6a58a001 100644
--- a/fallback.c
+++ b/fallback.c
@@ -158,7 +158,7 @@ read_file(EFI_FILE_HANDLE fh, CHAR16 *fullpath, CHAR16 **buffer, UINT64 *bs)
}
b = AllocateZeroPool(len + 2);
- if (!buffer) {
+ if (!b) {
console_print(L"Could not allocate memory\n");
fh2->Close(fh2);
return EFI_OUT_OF_RESOURCES;