]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict sql: If connect setting isn't given, give an error message instead of crashing.
authorTimo Sirainen <tss@iki.fi>
Fri, 6 Feb 2009 22:19:57 +0000 (17:19 -0500)
committerTimo Sirainen <tss@iki.fi>
Fri, 6 Feb 2009 22:19:57 +0000 (17:19 -0500)
--HG--
branch : HEAD

src/lib-dict/dict-sql-settings.c

index f3f8c91f8994d1a63aa101485b9212dddd99db16..0afa36218936a748e30e7571f125c5dd2817d0ac 100644 (file)
@@ -211,5 +211,11 @@ struct dict_sql_settings *dict_sql_settings_read(pool_t pool, const char *path)
        if (!settings_read(path, NULL, parse_setting, parse_section, &ctx))
                return NULL;
 
+       if (ctx.set->connect == NULL) {
+               i_error("Error in configuration file %s: "
+                       "Missing connect setting", path);
+               return NULL;
+       }
+
        return ctx.set;
 }