dovecot-2.1: auth: passdb static crashed if no password was given

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 19 16:03:28 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/809944f5015a
changeset: 13638:809944f5015a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 19 16:11:44 2011 +0300
description:
auth: passdb static crashed if no password was given

diffstat:

 src/auth/passdb-static.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r e3d2262e995a -r 809944f5015a src/auth/passdb-static.c
--- a/src/auth/passdb-static.c	Tue Oct 18 16:53:06 2011 +0300
+++ b/src/auth/passdb-static.c	Wed Oct 19 16:11:44 2011 +0300
@@ -24,9 +24,13 @@
 	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


More information about the dovecot-cvs mailing list