dovecot-2.0: lib-auth: Make sure auth_master_*_lookup() returns ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 5 04:03:08 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/5e3e00d11ca5
changeset: 11058:5e3e00d11ca5
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 05 04:03:05 2010 +0300
description:
lib-auth: Make sure auth_master_*_lookup() returns non-NULL fields.

diffstat:

 src/lib-auth/auth-master.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r f9e6078ca95c -r 5e3e00d11ca5 src/lib-auth/auth-master.c
--- a/src/lib-auth/auth-master.c	Mon Apr 05 03:57:23 2010 +0300
+++ b/src/lib-auth/auth-master.c	Mon Apr 05 04:03:05 2010 +0300
@@ -442,7 +442,8 @@
 
 	if (ctx.return_value <= 0 || ctx.fields[0] == NULL) {
 		*username_r = NULL;
-		*fields_r = ctx.fields;
+		*fields_r = ctx.fields != NULL ? ctx.fields :
+			p_new(pool, const char *, 1);
 		if (ctx.return_value > 0) {
 			i_error("Userdb lookup didn't return username");
 			ctx.return_value = -1;
@@ -511,7 +512,8 @@
 	(void)auth_master_run_cmd(conn, str_c(str));
 	conn->prefix = DEFAULT_USERDB_LOOKUP_PREFIX;
 
-	*fields_r = ctx.fields;
+	*fields_r = ctx.fields != NULL ? ctx.fields :
+		p_new(pool, const char *, 1);
 	return ctx.return_value;
 }
 


More information about the dovecot-cvs mailing list