From c6bd43ebb2c7d7a8ef66b3cfc3804ad1ee18ac65 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 10 Sep 2014 16:07:02 -0400
Subject: [PATCH 11/31] 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 d37227c..4ffb90e 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);
--
2.7.4