mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
gpg: Fix keyring retrieval.
* g10/keyring.c (keyring_get_keyblock): Avoid O(N^2) append. GnuPG-bug-id: 4592 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> (cherry picked from commit a7a043e82555a9da984c6fb01bfec4990d904690) Gbp-Pq: Topic from-master Gbp-Pq: Name gpg-Fix-keyring-retrieval.patch
This commit is contained in:
parent
ab76d64837
commit
9e12829299
@ -473,11 +473,14 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
in_cert = 1;
|
in_cert = 1;
|
||||||
node = lastnode = new_kbnode (pkt);
|
node = new_kbnode (pkt);
|
||||||
if (!keyblock)
|
if (!keyblock)
|
||||||
keyblock = node;
|
keyblock = lastnode = node;
|
||||||
else
|
else
|
||||||
add_kbnode (keyblock, node);
|
{
|
||||||
|
lastnode->next = node;
|
||||||
|
lastnode = node;
|
||||||
|
}
|
||||||
switch (pkt->pkttype)
|
switch (pkt->pkttype)
|
||||||
{
|
{
|
||||||
case PKT_PUBLIC_KEY:
|
case PKT_PUBLIC_KEY:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user