summaryrefslogtreecommitdiff
path: root/g10/keyring.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:21 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:21 +0900
commitd9f0d99e31569835e295b990029c6dd19554299c (patch)
treeecdcc994cad9a9b8a35e7ac495bd77eadf87a622 /g10/keyring.c
parente28f2fa5b31e90be72c2276f8cea3b22d309d406 (diff)
downloadgpg2-d9f0d99e31569835e295b990029c6dd19554299c.tar.gz
gpg2-d9f0d99e31569835e295b990029c6dd19554299c.tar.bz2
gpg2-d9f0d99e31569835e295b990029c6dd19554299c.zip
Imported Upstream version 2.1.21upstream/2.1.21
Diffstat (limited to 'g10/keyring.c')
-rw-r--r--g10/keyring.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/g10/keyring.c b/g10/keyring.c
index 51b7687..50f1b82 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -409,11 +409,11 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
pkt = xmalloc (sizeof *pkt);
init_packet (pkt);
init_parse_packet (&parsectx, a);
- hd->found.n_packets = 0;;
+ hd->found.n_packets = 0;
lastnode = NULL;
save_mode = set_packet_list_mode(0);
while ((rc=parse_packet (&parsectx, pkt)) != -1) {
- hd->found.n_packets++;
+ hd->found.n_packets = parsectx.n_parsed_packets;
if (gpg_err_code (rc) == GPG_ERR_UNKNOWN_PACKET) {
free_packet (pkt, &parsectx);
init_packet (pkt);
@@ -663,7 +663,6 @@ keyring_search_reset (KEYRING_HANDLE hd)
{
log_assert (hd);
- hd->current.kr = NULL;
iobuf_close (hd->current.iobuf);
hd->current.iobuf = NULL;
hd->current.eof = 0;
@@ -671,6 +670,12 @@ keyring_search_reset (KEYRING_HANDLE hd)
hd->found.kr = NULL;
hd->found.offset = 0;
+
+ if (hd->current.kr)
+ iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0,
+ (char*)hd->current.kr->fname);
+ hd->current.kr = NULL;
+
return 0;
}