]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: passdb static crashed if no password was given
authorTimo Sirainen <tss@iki.fi>
Wed, 19 Oct 2011 13:11:44 +0000 (16:11 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 19 Oct 2011 13:11:44 +0000 (16:11 +0300)
src/auth/passdb-static.c

index 1d6b117f693bd91128c7286333be5da2d69d4e1d..a8874e8a7422b211e232840cbb7838ff9b0dff5f 100644 (file)
@@ -24,9 +24,13 @@ static_save_fields(struct auth_request *request, const char **password_r)
        auth_request_log_debug(request, "static", "lookup");
        passdb_template_export(module->tmpl, request);
 
-       table = auth_request_get_var_expand_table(request, NULL);
-       var_expand(str, module->static_password_tmpl, table);
-       *password_r = str_c(str);
+       if (module->static_password_tmpl == NULL)
+               *password_r = NULL;
+       else {
+               table = auth_request_get_var_expand_table(request, NULL);
+               var_expand(str, module->static_password_tmpl, table);
+               *password_r = str_c(str);
+       }
 }
 
 static void