From e2c5781788f765815532410a77077ddbb72513e9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 29 Mar 2016 13:30:19 +0200 Subject: [PATCH] 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 --- g10/tofu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);