g10: Fix opening of trust database.
authorJustus Winter <justus@g10code.com>
Wed, 10 Aug 2016 14:41:22 +0000 (16:41 +0200)
committerJustus Winter <justus@g10code.com>
Wed, 10 Aug 2016 14:50:29 +0000 (16:50 +0200)
commita27410a251cd25ca96cd6743969c4db0a0fd553f
treed95d648babaaf0cd93878cc98435d5b6aec8bca7
parent194b1e979c7c547afd0dfea5b2496bdfa34b20f1
g10: Fix opening of trust database.

* g10/tdbio.c (tdbio_set_dbname): This function explicitly checks for
the file size, but handled the case of a zero-sized file incorrectly
by returning success.  Fix this by initializing the database in that
case.
* tests/openpgp/Makefile.am (XTESTS): Add new test.
* tests/openpgp/issue2417.scm: New file.

GnuPG-bug-id: 2417
Signed-off-by: Justus Winter <justus@g10code.com>
g10/tdbio.c
tests/openpgp/Makefile.am
tests/openpgp/issue2417.scm [new file with mode: 0755]