From: Jonathan McDowell Date: Mon, 19 Jun 2006 21:01:55 +0000 (+0000) Subject: Gracefully exit if no backend defined. X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/91a98f43c64a6f8c76efb78b8301efaf9c6db1fe?ds=sidebyside 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. --- 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_")