dovecot-1.0: When saving password, add scheme prefix also if pas...

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


details:   http://hg.dovecot.org/dovecot-1.0/rev/2fac33d5b1fc
changeset: 5461:2fac33d5b1fc
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 25 03:09:19 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 288fd70ac258 -r 2fac33d5b1fc src/auth/auth-request.c
--- a/src/auth/auth-request.c	Fri Nov 23 12:35:47 2007 +0200
+++ b/src/auth/auth-request.c	Sun Nov 25 03:09:19 2007 +0200
@@ -898,7 +898,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