From 80f25fab900b2b5a8efe93a39c3f46e915b51374 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 8 Aug 2024 17:13:47 +0200 Subject: agent: Fix an unitialized variable in an error path. * agent/findkey.c (agent_write_private_key): Init FP. -- With Fixes-commit: 3b69d8bf7146b8d10737d0cfea9c97affc60ad73 we took a shortcut but forgot to init FP which is usually set after the new check. At least in the AppImage this always triggered a segv and gpg or Kleopatra had to restart the agent. Not a problem in 2.4 becuase this code is a hack we don't need in 2.4 due to that new ephemeral key storing feature. GnuPG-bug-id: 6944 --- agent/findkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/findkey.c b/agent/findkey.c index a5055bcc4..5549842c4 100644 --- a/agent/findkey.c +++ b/agent/findkey.c @@ -91,7 +91,7 @@ agent_write_private_key (const unsigned char *grip, gpg_error_t err; char *oldfname = NULL; char *fname = NULL; - estream_t fp; + estream_t fp = NULL; int newkey = 0; nvc_t pk = NULL; gcry_sexp_t key = NULL; -- cgit v1.2.3