From 91a98f43c64a6f8c76efb78b8301efaf9c6db1fe Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 19 Jun 2006 21:01:55 +0000 Subject: [PATCH] Gracefully exit if no backend defined. If no backend was defined we were attempting to strlen a NULL string, which isn't sensible. Gracefully exit with a critical error instead. --- keydb_dynamic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keydb_dynamic.c b/keydb_dynamic.c index ca489ae..f12889c 100644 --- a/keydb_dynamic.c +++ b/keydb_dynamic.c @@ -39,6 +39,11 @@ bool load_backend(void) close_backend(); } + if (!config.db_backend) { + logthing(LOGTHING_CRITICAL, "No database backend defined."); + exit(EXIT_FAILURE); + } + if (config.backends_dir == NULL) { soname = malloc(strlen(config.db_backend) + strlen("/libkeydb_") -- 2.39.5