mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
Fix for bug#1034.
This commit is contained in:
parent
418e61a824
commit
23ad4bd73b
2
NEWS
2
NEWS
@ -6,6 +6,8 @@ Noteworthy changes in version 1.4.10 (unreleased)
|
|||||||
|
|
||||||
* Improved file locking. Implemented it for W32.
|
* Improved file locking. Implemented it for W32.
|
||||||
|
|
||||||
|
* Fixed a memory leak which made imports of many keys very slow.
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 1.4.9 (2008-03-26)
|
Noteworthy changes in version 1.4.9 (2008-03-26)
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2009-05-06 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* keyring.c (keyring_get_keyblock): Fix memory leak due to
|
||||||
|
ring_trust packets. Fixes bug#1034.
|
||||||
|
|
||||||
|
* getkey.c (finish_lookup): Remove dead code.
|
||||||
|
|
||||||
2009-05-05 Werner Koch <wk@g10code.com>
|
2009-05-05 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* keygen.c (read_parameter_file): Add keyword "Creation-Date".
|
* keygen.c (read_parameter_file): Add keyword "Creation-Date".
|
||||||
|
10
g10/getkey.c
10
g10/getkey.c
@ -2542,16 +2542,6 @@ finish_lookup (GETKEY_CTX ctx)
|
|||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!req_usage) {
|
|
||||||
PKT_public_key *pk = foundk->pkt->pkt.public_key;
|
|
||||||
if (pk->user_id)
|
|
||||||
free_user_id (pk->user_id);
|
|
||||||
pk->user_id = scopy_user_id (foundu);
|
|
||||||
ctx->found_key = foundk;
|
|
||||||
cache_user_id( keyblock );
|
|
||||||
return 1; /* found */
|
|
||||||
}
|
|
||||||
|
|
||||||
latest_date = 0;
|
latest_date = 0;
|
||||||
latest_key = NULL;
|
latest_key = NULL;
|
||||||
/* do not look at subkeys if a certification key is requested */
|
/* do not look at subkeys if a certification key is requested */
|
||||||
|
@ -419,19 +419,23 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
|
|||||||
if ( lastnode
|
if ( lastnode
|
||||||
&& lastnode->pkt->pkttype == PKT_SIGNATURE
|
&& lastnode->pkt->pkttype == PKT_SIGNATURE
|
||||||
&& (pkt->pkt.ring_trust->sigcache & 1) ) {
|
&& (pkt->pkt.ring_trust->sigcache & 1) ) {
|
||||||
/* this is a ring trust packet with a checked signature
|
/* This is a ring trust packet with a checked signature
|
||||||
* status cache following directly a signature paket.
|
* status cache following directly a signature paket.
|
||||||
* Set the cache status into that signature packet */
|
* Set the cache status into that signature packet. */
|
||||||
PKT_signature *sig = lastnode->pkt->pkt.signature;
|
PKT_signature *sig = lastnode->pkt->pkt.signature;
|
||||||
|
|
||||||
sig->flags.checked = 1;
|
sig->flags.checked = 1;
|
||||||
sig->flags.valid = !!(pkt->pkt.ring_trust->sigcache & 2);
|
sig->flags.valid = !!(pkt->pkt.ring_trust->sigcache & 2);
|
||||||
}
|
}
|
||||||
/* reset lastnode, so that we set the cache status only from
|
/* Reset LASTNODE, so that we set the cache status only
|
||||||
* the ring trust packet immediately folling a signature */
|
* from the ring trust packets immediately following
|
||||||
|
* signature packets. */
|
||||||
lastnode = NULL;
|
lastnode = NULL;
|
||||||
|
free_packet(pkt);
|
||||||
|
init_packet(pkt);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
node = lastnode = new_kbnode (pkt);
|
node = lastnode = new_kbnode (pkt);
|
||||||
if (!keyblock)
|
if (!keyblock)
|
||||||
keyblock = node;
|
keyblock = node;
|
||||||
@ -441,15 +445,16 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
|
|||||||
if ( pkt->pkttype == PKT_PUBLIC_KEY
|
if ( pkt->pkttype == PKT_PUBLIC_KEY
|
||||||
|| pkt->pkttype == PKT_PUBLIC_SUBKEY
|
|| pkt->pkttype == PKT_PUBLIC_SUBKEY
|
||||||
|| pkt->pkttype == PKT_SECRET_KEY
|
|| pkt->pkttype == PKT_SECRET_KEY
|
||||||
|| pkt->pkttype == PKT_SECRET_SUBKEY) {
|
|| pkt->pkttype == PKT_SECRET_SUBKEY)
|
||||||
|
{
|
||||||
if (++pk_no == hd->found.pk_no)
|
if (++pk_no == hd->found.pk_no)
|
||||||
node->flag |= 1;
|
node->flag |= 1;
|
||||||
}
|
}
|
||||||
else if ( pkt->pkttype == PKT_USER_ID) {
|
else if ( pkt->pkttype == PKT_USER_ID)
|
||||||
|
{
|
||||||
if (++uid_no == hd->found.uid_no)
|
if (++uid_no == hd->found.uid_no)
|
||||||
node->flag |= 2;
|
node->flag |= 2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pkt = xmalloc (sizeof *pkt);
|
pkt = xmalloc (sizeof *pkt);
|
||||||
init_packet(pkt);
|
init_packet(pkt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user