Blob Blame History Raw
From 58bfbf6c4fed6dfb875cd59ae9e04986a1cdcd2c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 10 Sep 2014 16:07:02 -0400
Subject: [PATCH 10/18] Covscan can't tell that we're not filling a buffer...

Because the pattern here is:

rc = func_call(buf, buflen)
if (rc < 0)
	return error;
buflen = rc;
buf = calloc(1, buflen)
if (!buf)
	return error;
rc = func_call(buf, buflen);

Covscan thinks the first func_call() might actually be doing something
to buf.  It isn't, but that's not obvious.  So make it NULL and 0
instead of buf and buflen on the first call.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 src/efibootmgr/efibootmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index 5280180..31807a9 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -772,7 +772,7 @@ show_boot_vars()
 				continue;
 			}
 
-			rc = unparse_raw_text(text_path, text_path_len,
+			rc = unparse_raw_text(NULL, 0,
 				((uint8_t *)path)
 					+ load_option->file_path_list_length,
 				optional_data_len);
-- 
1.9.3