aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-08-08 15:13:47 +0000
committerWerner Koch <[email protected]>2024-08-08 15:13:47 +0000
commit80f25fab900b2b5a8efe93a39c3f46e915b51374 (patch)
treecdb754d5c55568f5c56d01e4766c11cd68a84df8
parentcommon: Allow building with libgpg-error < 1.47 (diff)
downloadgnupg-80f25fab900b2b5a8efe93a39c3f46e915b51374.tar.gz
gnupg-80f25fab900b2b5a8efe93a39c3f46e915b51374.zip
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
-rw-r--r--agent/findkey.c2
1 files changed, 1 insertions, 1 deletions
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;