summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-03-29 13:30:19 +0200
committerWerner Koch <wk@gnupg.org>2016-03-29 13:30:19 +0200
commite2c5781788f765815532410a77077ddbb72513e9 (patch)
treeea052ca56a1a489d045866542555067291c235f4
parentgpg: Improve message when asking for key capabilities. (diff)
downloadgnupg2-e2c5781788f765815532410a77077ddbb72513e9.tar.xz
gnupg2-e2c5781788f765815532410a77077ddbb72513e9.zip
gpg: Fix NULL-segv for missing tofu DB.
* g10/tofu.c (opendb): Guard call to timeout function. -- GnuPG-bug-id: 2294 Fix not tested but is pretty obvious. Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r--g10/tofu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/tofu.c b/g10/tofu.c
index 6a8817237..baa2ac235 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -706,7 +706,8 @@ opendb (char *filename, enum db_type type)
/* If a DB is locked wait up to 5 seconds for the lock to be cleared
before failing. */
- sqlite3_busy_timeout (db, 5 * 1000);
+ if (db)
+ sqlite3_busy_timeout (db, 5 * 1000);
if (filename_free)
xfree (filename);