Add patch via 'git add'

This commit is contained in:
Stefan Berger 2022-11-10 15:00:55 -05:00
parent 98181cdb15
commit e8eba58a6f
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 5b8c9d205a59932ce4e1894dbf09f5df4cfbb907 Mon Sep 17 00:00:00 2001
From: Stefan Berger <stefanb@linux.ibm.com>
Date: Thu, 10 Nov 2022 14:20:53 -0500
Subject: [PATCH] swtpm_setup: Initialized **argv to NULL (Fedore Rawhide)
gcc 12.2.1 on Fedora Rawhide emits this message:
In file included from /usr/include/glib-2.0/glib.h:116,
from swtpm_setup.c:26:
In function 'g_autoptr_cleanup_generic_gfree',
inlined from 'get_swtpm_capabilities.constprop.0' at swtpm_setup.c:940:24:
/usr/include/glib-2.0/glib/glib-autocleanups.h:30:3: error: 'argv' may be used uninitialized [-Werror=maybe-uninitialized]
30 | g_free (*pp);
| ^~~~~~~~~~~~
swtpm_setup.c: In function 'get_swtpm_capabilities.constprop.0':
swtpm_setup.c:940:24: note: 'argv' was declared here
940 | g_autofree gchar **argv;
| ^~~~
cc1: all warnings being treated as errors
This makes little sense since the variable is then first used like this:
argv = concat_arrays(swtpm_prg_l, my_argv, FALSE);
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
src/swtpm_setup/swtpm_setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/swtpm_setup/swtpm_setup.c b/src/swtpm_setup/swtpm_setup.c
index 1b528c8..3570235 100644
--- a/src/swtpm_setup/swtpm_setup.c
+++ b/src/swtpm_setup/swtpm_setup.c
@@ -937,7 +937,7 @@ static int get_swtpm_capabilities(gchar **swtpm_prg_l, gboolean is_tpm2,
gchar *my_argv[] = { "--print-capabilities", is_tpm2 ? "--tpm2" : NULL, NULL };
g_autofree gchar *logop = NULL;
g_autoptr(GError) error = NULL;
- g_autofree gchar **argv;
+ g_autofree gchar **argv = NULL;
int exit_status = 0;
gboolean success;
int ret = 1;
--
2.38.0

View File

@ -1 +1 @@
SHA512 (0001-swtpm_setup-Initialized-argv-to-NULL-Fedore-Rawhide.patch) = 72d78bafdcdffc6cddefc819492d7ef45c619cb9e86886ce3cbeb6c1d6ab8e8242bd38ac8aa5b2f16a6fc51a4881177ae77b620b3a6f1773dd14deb715ea6e9f
SHA512 (swtpm-2ae7b01.tar.gz) = 3ca7e8af0b100ef66b416d34f5209cb7ac7f27c4805d24ada15aef2aa895bc7240323252e693b4bbcb47fcd19ce6f6b962b762685b49c7bfd8c1afcabe64b639