2002-06-01 13:39 */base64.c fetchmail-aatharuv-5.9.11/base64.c Page 1 --- fetchmail-5.9.11/base64.c Wed Oct 3 05:37:33 2001 +++ fetchmail-aatharuv-5.9.11/base64.c Sat Jun 1 12:40:28 2002 @@ -54,6 +54,7 @@ int from64tobits(char *out, const char *in, int maxlen) /* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */ +/* maxlen limits output buffer size, set to zero to ignore */ { int len = 0; register unsigned char digit1, digit2, digit3, digit4; @@ -78,17 +79,21 @@ return(-1); in += 4; ++len; - if (len && len >= maxlen) /* prevent buffer overflow */ + if (maxlen && len > maxlen) return(-1); *out++ = (DECODE64(digit1) << 2) | (DECODE64(digit2) >> 4); if (digit3 != '=') { - *out++ = ((DECODE64(digit2) << 4) & 0xf0) | (DECODE64(digit3) >> 2); ++len; + if (maxlen && len > maxlen) + return(-1); + *out++ = ((DECODE64(digit2) << 4) & 0xf0) | (DECODE64(digit3) >> 2); if (digit4 != '=') { + ++len; + if (maxlen && len > maxlen) + return(-1); *out++ = ((DECODE64(digit3) << 6) & 0xc0) | DECODE64(digit4); - ++len; } } } while 2002-06-01 13:39 */driver.c fetchmail-aatharuv-5.9.11/driver.c Page 1 --- fetchmail-5.9.11/driver.c Mon Apr 1 02:46:58 2002 +++ fetchmail-aatharuv-5.9.11/driver.c Sat Jun 1 12:44:51 2002 @@ -1039,6 +1039,6 @@ set_timeout(0); phase = oldphase; #ifdef KERBEROS_V4 - if (ctl->server.authenticate == A_KERBEROS_V4) + if (ctl->server.authenticate == A_KERBEROS_V4 && (strcasecmp(proto->name,"IMAP") != 0)) { set_timeout(mytimeout);