dovecot-2.2: auth: Fixed passdb_import not to crash when =value ...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 5 00:13:33 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/00de06c6cc21
changeset: 16189:00de06c6cc21
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Mar 31 17:47:52 2013 +0300
description:
auth: Fixed passdb_import not to crash when =value isn't given.

diffstat:

 src/auth/auth-request.c |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (23 lines):

diff -r 963c6f616aa4 -r 00de06c6cc21 src/auth/auth-request.c
--- a/src/auth/auth-request.c	Sun Mar 31 17:44:34 2013 +0300
+++ b/src/auth/auth-request.c	Sun Mar 31 17:47:52 2013 +0300
@@ -1246,16 +1246,10 @@
 auth_request_passdb_import(struct auth_request *request,
 			   const char *args, const char *default_scheme)
 {
-	const char *key, *value, *const *arg = t_strsplit(args, "\t");
+	const char *const *arg;
 
-	for (; *arg != NULL; arg++) {
-		value = strchr(*arg, '=');
-		if (value == NULL)
-			key = *arg;
-		else
-			key = t_strdup_until(*arg, value++);
-		auth_request_set_field(request, key, value, default_scheme);
-	}
+	for (arg = t_strsplit(args, "\t"); *arg != NULL; arg++)
+		auth_request_set_field_keyvalue(request, *arg, default_scheme);
 }
 
 void auth_request_set_field(struct auth_request *request,


More information about the dovecot-cvs mailing list