From 8abc11f65c828a58263e4b4a8eac70fdf7082792 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 20 Feb 2020 08:53:04 +0000 Subject: [PATCH] efihttp_fs_seek() is missing NULL pointer check Add missing check of malloc() result. --- stand/efi/libefi/efihttp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c index e637da23a08..2894709ca03 100644 --- a/stand/efi/libefi/efihttp.c +++ b/stand/efi/libefi/efihttp.c @@ -701,6 +701,8 @@ efihttp_fs_seek(struct open_file *f, off_t offset, int where) return (0); if (where == SEEK_SET && fh->offset < offset) { buf = malloc(1500); + if (buf == NULL) + return (ENOMEM); res = offset - fh->offset; while (res > 0) { err = _efihttp_fs_read(f, buf, min(1500, res), &res2); -- 2.45.0