]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
gssapi: Apparently all usernames end with NUL. Allow it.
authorTimo Sirainen <tss@iki.fi>
Fri, 28 Aug 2009 20:50:39 +0000 (16:50 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 28 Aug 2009 20:50:39 +0000 (16:50 -0400)
--HG--
branch : HEAD

src/auth/mech-gssapi.c

index 06c8f269af8b191e1490aa3ac24c534a32cafd8c..1fdfc20f16c4afc577da296cbc4b4cb6fcd05dab 100644 (file)
@@ -219,6 +219,10 @@ static bool data_has_nuls(const void *data, unsigned int len)
        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')
                        return TRUE;