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