Blame SOURCES/0010-Covscan-can-t-tell-that-we-re-not-filling-a-buffer.patch

5fb29d
From 58bfbf6c4fed6dfb875cd59ae9e04986a1cdcd2c Mon Sep 17 00:00:00 2001
5fb29d
From: Peter Jones <pjones@redhat.com>
5fb29d
Date: Wed, 10 Sep 2014 16:07:02 -0400
5fb29d
Subject: [PATCH 10/18] Covscan can't tell that we're not filling a buffer...
5fb29d
5fb29d
Because the pattern here is:
5fb29d
5fb29d
rc = func_call(buf, buflen)
5fb29d
if (rc < 0)
5fb29d
	return error;
5fb29d
buflen = rc;
5fb29d
buf = calloc(1, buflen)
5fb29d
if (!buf)
5fb29d
	return error;
5fb29d
rc = func_call(buf, buflen);
5fb29d
5fb29d
Covscan thinks the first func_call() might actually be doing something
5fb29d
to buf.  It isn't, but that's not obvious.  So make it NULL and 0
5fb29d
instead of buf and buflen on the first call.
5fb29d
5fb29d
Signed-off-by: Peter Jones <pjones@redhat.com>
5fb29d
---
5fb29d
 src/efibootmgr/efibootmgr.c | 2 +-
5fb29d
 1 file changed, 1 insertion(+), 1 deletion(-)
5fb29d
5fb29d
diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
5fb29d
index 5280180..31807a9 100644
5fb29d
--- a/src/efibootmgr/efibootmgr.c
5fb29d
+++ b/src/efibootmgr/efibootmgr.c
5fb29d
@@ -772,7 +772,7 @@ show_boot_vars()
5fb29d
 				continue;
5fb29d
 			}
5fb29d
 
5fb29d
-			rc = unparse_raw_text(text_path, text_path_len,
5fb29d
+			rc = unparse_raw_text(NULL, 0,
5fb29d
 				((uint8_t *)path)
5fb29d
 					+ load_option->file_path_list_length,
5fb29d
 				optional_data_len);
5fb29d
-- 
5fb29d
1.9.3
5fb29d