On 2025-06-18 07:28, Andrew Hamilton wrote:
In function protect_tpm2_export_tpm2key, the 'err' variable
is uninitialized in the normal (error free) path, so ensure this
defaults to GRUB_ERR_NONE.
This causes the GRUB build to fail with clang (observed with
clang-14).
Fixes: 5934bf51c (util/grub-protect: Support NV index mode)
Signed-off-by: Andrew Hamilton <adham...@gmail.com>
Reviewed-by: Sudhakar Kuppusamy <sudha...@linux.ibm.com>
---
util/grub-protect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/grub-protect.c b/util/grub-protect.c
index d53c2572d..868eb76b9 100644
--- a/util/grub-protect.c
+++ b/util/grub-protect.c
@@ -703,7 +703,7 @@ protect_tpm2_export_tpm2key (const protect_args_t
*args, tpm2_sealed_key_t *seal
struct grub_tpm2_buffer priv_buf;
int i;
int ret;
- grub_err_t err;
+ grub_err_t err = GRUB_ERR_NONE;
if (der_buf == NULL)
return GRUB_ERR_BAD_ARGUMENT;
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel