[PATCH GnuPG 6/7] g10: fix uninit use
Sam James
sam at gentoo.org
Wed Jan 28 13:35:06 CET 2026
* g10/encrypt.c (reencrypt_to_new_recipients): Drop first
(and uninitialized) use of 'count'.
--
In reencrypt_to_new_recipients, count isn't used in the first loop
and we later initialise it before another loop (where it is used), so
drop the first bogus use, as the increment was working w/ an uninit var
otherwise.
Found by GCC's -fanalyzer.
Signed-off-by: Sam James <sam at gentoo.org>
---
g10/encrypt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/g10/encrypt.c b/g10/encrypt.c
index b305ce938..19b2f7d13 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -1114,7 +1114,7 @@ reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename,
* recipient. We can't do that for wildcards, though. */
if (!ctrl->clear_recipients)
{
- for (el = sesenc_list; el; el = el->next, count++)
+ for (el = sesenc_list; el; el = el->next)
{
if (el->u_sym)
continue;
--
2.52.0
More information about the Gnupg-devel
mailing list