Blame SOURCES/0015-Fix-uninitialized-variable.patch

453bef
From 2fe9e690e019d2e25db3be22b57623c0618148d7 Mon Sep 17 00:00:00 2001
453bef
From: Mirco Tischler <mt-ml@gmx.de>
453bef
Date: Mon, 6 Mar 2017 23:45:46 +0100
453bef
Subject: [PATCH] Fix uninitialized variable.
453bef
453bef
If boot_order_size is 0, i was never set. On gcc-6.3.1, this broke the
453bef
build if compiled with -O2 (-Werror=maybe_uninitialized). This is the
453bef
error:
453bef
453bef
libfwup.c: In function 'set_up_boot_next':
453bef
libfwup.c:818:16: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized]
453bef
  new_boot_order[i] = boot_entry;
453bef
                ^
453bef
libfwup.c:780:15: note: 'i' was declared here
453bef
  unsigned int i;
453bef
               ^
453bef
cc1: all warnings being treated as errors
453bef
---
453bef
 linux/libfwup.c | 2 +-
453bef
 1 file changed, 1 insertion(+), 1 deletion(-)
453bef
453bef
diff --git a/linux/libfwup.c b/linux/libfwup.c
453bef
index 232eb77..30cf56a 100644
453bef
--- a/linux/libfwup.c
453bef
+++ b/linux/libfwup.c
453bef
@@ -790,7 +790,7 @@ add_to_boot_order(uint16_t boot_entry)
453bef
 			EFI_VARIABLE_BOOTSERVICE_ACCESS |
453bef
 			EFI_VARIABLE_RUNTIME_ACCESS;
453bef
 	int rc;
453bef
-	unsigned int i;
453bef
+	unsigned int i = 0;
453bef
 
453bef
 	rc = efi_get_variable_size(efi_guid_global, "BootOrder",
453bef
 				   &boot_order_size);
453bef
-- 
453bef
2.12.2
453bef