aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jelen <[email protected]>2021-09-13 16:26:29 +0000
committerNIIBE Yutaka <[email protected]>2021-11-12 06:36:02 +0000
commitae3d0bb8e77ce1b2a096fff7d783c781c9f7a502 (patch)
treecd153b41c7ec57480113e064be475a39c105b4b8
parentagent: Correctly free memory on error path. (diff)
downloadgnupg-ae3d0bb8e77ce1b2a096fff7d783c781c9f7a502.tar.gz
gnupg-ae3d0bb8e77ce1b2a096fff7d783c781c9f7a502.zip
agent: Avoid uninitialized buffer.
* agent/sexp-secret.c (fixup_when_ecc_private_key): Initialize buffer to avoid its use on unexpected inputs. -- GnuPG-bug-id: 5393 Co-authored-by: NIIBE Yutaka <[email protected]> Signed-off-by: Jakub Jelen <[email protected]>
-rw-r--r--agent/sexp-secret.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/sexp-secret.c b/agent/sexp-secret.c
index b539659e2..ac8daa910 100644
--- a/agent/sexp-secret.c
+++ b/agent/sexp-secret.c
@@ -29,7 +29,7 @@ gpg_error_t
fixup_when_ecc_private_key (unsigned char *buf, size_t *buflen_p)
{
const unsigned char *s;
- char curve_name[256];
+ char curve_name[256] = { 0, };
size_t n;
size_t buflen = *buflen_p;