From: Jonathan McDowell Date: Mon, 19 Jun 2006 21:01:55 +0000 (+0000) Subject: Gracefully exit if no backend defined. X-Git-Tag: 0.3.3~14 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=91a98f43c64a6f8c76efb78b8301efaf9c6db1fe;p=onak.git 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_")