aboutsummaryrefslogtreecommitdiffstats
path: root/kbx/keybox-search.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-05-16 11:57:04 +0000
committerWerner Koch <[email protected]>2019-05-16 11:57:04 +0000
commit6fc5df1e10129f3171d80cf731f310b9e8d97c26 (patch)
tree9d60610bc0324a2aca86f9871b5106faa562ccba /kbx/keybox-search.c
parentgpgconf: Before --launch check that the config file is fine. (diff)
downloadgnupg-6fc5df1e10129f3171d80cf731f310b9e8d97c26.tar.gz
gnupg-6fc5df1e10129f3171d80cf731f310b9e8d97c26.zip
kbx: Fix an endless loop under Windows due to an incomplete fix.
* kbx/keybox-search.c (keybox_search): We need to seek to the last position in all cases not just when doing a NEXT. -- This is because search from the beginning needs a keybox_search_reset. We can only make an exception for KEYDB_SEARCH_MODE_FIRST.. Fixes-commit: 49b236af0ecbb6df67513feb4b63851f2e159ea2 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'kbx/keybox-search.c')
-rw-r--r--kbx/keybox-search.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c
index 1600861a8..77469a24c 100644
--- a/kbx/keybox-search.c
+++ b/kbx/keybox-search.c
@@ -932,9 +932,9 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc,
return rc;
}
/* log_debug ("%s: re-opened file\n", __func__); */
- if (ndesc && desc[0].mode == KEYDB_SEARCH_MODE_NEXT && lastfoundoff)
+ if (ndesc && desc[0].mode != KEYDB_SEARCH_MODE_FIRST && lastfoundoff)
{
- /* Search mode is next and the last search operation
+ /* Search mode is not first and the last search operation
* returned a blob which also was not the first one. We now
* need to skip over that blob and hope that the file has
* not changed. */