aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-03-13 10:35:34 +0000
committerWerner Koch <[email protected]>2025-03-13 10:39:17 +0000
commit0666a8858fafefb6664c976eb94b73550a7e3da4 (patch)
tree64c1097cf29dcd48aa9468653d7b5cc211ac7fe0
parentpo: Update Japanese Translation. (diff)
downloadgnupg-0666a8858fafefb6664c976eb94b73550a7e3da4.tar.gz
gnupg-0666a8858fafefb6664c976eb94b73550a7e3da4.zip
gpg: Fix double free of internal data.
* g10/sig-check.c (check_signature_over_key_or_uid): Do not free in no-sig-cache mode if allocated by caller. -- GnuPG-bug-id: 7547 Fixes-commit: 44cdb9d73f1a0b7d2c8483a119b9c4d6caabc1ec
-rw-r--r--g10/sig-check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/sig-check.c b/g10/sig-check.c
index 09d5a8b5f..2ee1ff5b2 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -943,7 +943,8 @@ check_signature_over_key_or_uid (ctrl_t ctrl, PKT_public_key *signer,
rc = get_pubkey_for_sig (ctrl, signer, sig, NULL);
if (rc)
{
- xfree (signer);
+ if (signer_alloced != 1)
+ xfree (signer);
signer = NULL;
signer_alloced = 0;
goto leave;