[Pkg-gnupg-commit] [gpgme] 44/132: core: Fix leakage of address for mail only uids
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Apr 26 01:01:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gpgme.
commit b5075030bec9b21bf4e515bc1686df3fa43eced2
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Feb 1 18:03:35 2017 +0100
core: Fix leakage of address for mail only uids
* src/key.c (gpgme_key_unref): Always free address if set.
(_gpgme_key_append_name): Remove memory optimization for address.
--
The check if address is not allocated would now be more complicated
then just comparing it to email because email is set to address
also when an email was not parsed from the user id.
---
src/key.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/key.c b/src/key.c
index fed020e..e33abd0 100644
--- a/src/key.c
+++ b/src/key.c
@@ -236,12 +236,6 @@ _gpgme_key_append_name (gpgme_key_t key, const char *src, int convert)
&uid->comment, dst);
uid->address = _gpgme_mailbox_from_userid (uid->uid);
- if (uid->address && uid->email && !strcmp (uid->address, uid->email))
- {
- /* The ADDRESS is the same as EMAIL: Save some space. */
- free (uid->address);
- uid->address = uid->email;
- }
if ((!uid->email || !*uid->email) && uid->address && uid->name
&& !strcmp (uid->name, uid->address))
{
@@ -394,9 +388,7 @@ gpgme_key_unref (gpgme_key_t key)
tofu = tofu_next;
}
- if (uid->address && uid->address != uid->email)
- free (uid->address);
-
+ free (uid->address);
free (uid);
uid = next_uid;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list