dovecot: When saving password, add scheme prefix also if passwor...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 25 03:09:24 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/074ae6017b0a
changeset: 6854:074ae6017b0a
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 25 03:09:20 2007 +0200
description:
When saving password, add scheme prefix also if password begins with { but
doesn't contain }. This fixes an assert-crash later.

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/auth/auth-request.c |    6 +++++-

diffs (16 lines):

diff -r 7717e03db8b3 -r 074ae6017b0a src/auth/auth-request.c
--- a/src/auth/auth-request.c	Sat Nov 24 15:21:38 2007 +0200
+++ b/src/auth/auth-request.c	Sun Nov 25 03:09:20 2007 +0200
@@ -961,7 +961,11 @@ void auth_request_set_field(struct auth_
 			return;
 		}
 
-		if (*value == '{') {
+		/* if the password starts with '{' it most likely contains
+		   also '}'. check it anyway to make sure, because we
+		   assert-crash later if it doesn't exist. this could happen
+		   if plaintext passwords are used. */
+		if (*value == '{' && strchr(value, '}') != NULL) {
 			request->passdb_password =
 				p_strdup(request->pool, value);
 		} else {


More information about the dovecot-cvs mailing list