diff --git a/0001-swtpm_setup-Initialized-argv-to-NULL-Fedore-Rawhide.patch b/0001-swtpm_setup-Initialized-argv-to-NULL-Fedore-Rawhide.patch new file mode 100644 index 0000000..efc0b27 --- /dev/null +++ b/0001-swtpm_setup-Initialized-argv-to-NULL-Fedore-Rawhide.patch @@ -0,0 +1,45 @@ +From 5b8c9d205a59932ce4e1894dbf09f5df4cfbb907 Mon Sep 17 00:00:00 2001 +From: Stefan Berger +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 +--- + 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 + diff --git a/sources b/sources index a8d325b..21724dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (0001-swtpm_setup-Initialized-argv-to-NULL-Fedore-Rawhide.patch) = 72d78bafdcdffc6cddefc819492d7ef45c619cb9e86886ce3cbeb6c1d6ab8e8242bd38ac8aa5b2f16a6fc51a4881177ae77b620b3a6f1773dd14deb715ea6e9f +SHA512 (swtpm-2ae7b01.tar.gz) = 3ca7e8af0b100ef66b416d34f5209cb7ac7f27c4805d24ada15aef2aa895bc7240323252e693b4bbcb47fcd19ce6f6b962b762685b49c7bfd8c1afcabe64b639