dovecot-2.0: gssapi: Apparently all usernames end with NUL. Allo...

dovecot at dovecot.org dovecot at dovecot.org
Fri Aug 28 23:50:48 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/7f05f59d4205
changeset: 9824:7f05f59d4205
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Aug 28 16:50:39 2009 -0400
description:
gssapi: Apparently all usernames end with NUL. Allow it.

diffstat:

1 file changed, 4 insertions(+)
src/auth/mech-gssapi.c |    4 ++++

diffs (14 lines):

diff -r 9996521d883a -r 7f05f59d4205 src/auth/mech-gssapi.c
--- a/src/auth/mech-gssapi.c	Fri Aug 28 15:25:30 2009 -0400
+++ b/src/auth/mech-gssapi.c	Fri Aug 28 16:50:39 2009 -0400
@@ -218,6 +218,10 @@ static bool data_has_nuls(const void *da
 {
 	const unsigned char *c = data;
 	unsigned int i;
+
+	/* apparently all names end with NUL? */
+	if (len > 0 && c[len-1] == '\0')
+		len--;
 
 	for (i = 0; i < len; i++) {
 		if (c[i] == '\0')


More information about the dovecot-cvs mailing list