[PATCH] uefirtvariable: clean up pedantic static analysis warnings

Colin King colin.king at canonical.com
Wed Sep 22 08:56:02 UTC 2021


From: Colin Ian King <colin.king at canonical.com>

Static analysis is warning that attributestest may be uninitialized.
Clean this up by setting the variable to zero.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index 9f2b9dfc..095d2f64 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -129,7 +129,7 @@ static int getvariable_test(
 	uint8_t testdata[MAX_DATA_LENGTH];
 	uint64_t dataindex;
 	uint64_t getdatasize = sizeof(testdata);
-	uint32_t attributestest;
+	uint32_t attributestest = 0;
 
 	uint8_t data[datasize];
 	uint32_t i;
-- 
2.32.0




More information about the fwts-devel mailing list