mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
g10: Have keydb_search_first call keydb_search_reset before searching.
* g10/keydb.c (keydb_search_first): Reset the handle before starting the search. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>. This bug hasn't shown up yet in practice, because keydb_search_first is always called immediately after a keydb_new. This changes cleans up the semantics and will hopefully prevent future bugs.
This commit is contained in:
parent
0377db4b35
commit
11d8ffc939
@ -1731,6 +1731,10 @@ keydb_search_first (KEYDB_HANDLE hd)
|
||||
gpg_error_t err;
|
||||
KEYDB_SEARCH_DESC desc;
|
||||
|
||||
err = keydb_search_reset (hd);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
memset (&desc, 0, sizeof desc);
|
||||
desc.mode = KEYDB_SEARCH_MODE_FIRST;
|
||||
err = keydb_search (hd, &desc, 1, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user