gpg: Return better error codes in case of a too short trustdb.
authorWerner Koch <wk@gnupg.org>
Mon, 26 Mar 2018 15:43:40 +0000 (17:43 +0200)
committerWerner Koch <wk@gnupg.org>
Mon, 26 Mar 2018 15:55:03 +0000 (17:55 +0200)
commit403aa70c52e56614d65490dea9344113f9cf3d29
tree98f8593af4c97b8af3fc54764fe0d2a4b740c6e7
parent456a3a8e93ea14f821e0e98fb515f284ece98685
gpg: Return better error codes in case of a too short trustdb.

* g10/tdbio.c (tdbio_read_record): Return GPG_ERR_EOF.
(tdbio_new_recnum): Never return on error.
(lookup_hashtable): Print a more descriptive error in case of !TABLE.
--

Also: tdbio_new_recnum had a bug in that it returned an error code and
not a record number in the error case.  The function is expected to
always return a valid new record number.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/tdbio.c