Blame SOURCES/0017-efi_loadopt_args_from_file-make-sure-buf-is-only-NUL.patch

ac385c
From d251242a71ef01626444180c630330bcfb0ca69e Mon Sep 17 00:00:00 2001
ac385c
From: Peter Jones <pjones@redhat.com>
ac385c
Date: Mon, 1 May 2017 15:19:18 -0400
ac385c
Subject: [PATCH 17/22] efi_loadopt_args_from_file(): make sure buf is only
ac385c
 NULL if size is.
ac385c
ac385c
This avoids passing NULL to fread().
ac385c
ac385c
Found by covscan.
ac385c
ac385c
Signed-off-by: Peter Jones <pjones@redhat.com>
ac385c
---
ac385c
 src/loadopt.c | 2 +-
ac385c
 1 file changed, 1 insertion(+), 1 deletion(-)
ac385c
ac385c
diff --git a/src/loadopt.c b/src/loadopt.c
ac385c
index 8db8074..5301f3d 100644
ac385c
--- a/src/loadopt.c
ac385c
+++ b/src/loadopt.c
ac385c
@@ -269,7 +269,7 @@ efi_loadopt_args_from_file(uint8_t *buf, ssize_t size, char *filename)
ac385c
 	int saved_errno;
ac385c
 	FILE *f;
ac385c
 
ac385c
-	if (!buf && size > 0) {
ac385c
+	if (!buf && size != 0) {
ac385c
 		errno = -EINVAL;
ac385c
 		return -1;
ac385c
 	}
ac385c
-- 
ac385c
2.12.2
ac385c