karsten / rpms / uw-imap

Forked from rpms/uw-imap 6 years ago
Clone
3d87698
--- imap-2001a/src/c-client/rfc822.c.overflow	Wed Apr 17 22:39:13 2002
3d87698
+++ imap-2001a/src/c-client/rfc822.c	Wed Apr 17 22:40:25 2002
3d87698
@@ -610,6 +610,9 @@
3d87698
 	if (CHR (bs) == '\012'){/* following LF? */
3d87698
 	  c = SNX (bs); i--;	/* yes, slurp it */
3d87698
 	}
3d87698
+	if (!i)			/* Make sure we don't get an overflow for */
3d87698
+	  break;		/* messages ending on \015 (or the following */
3d87698
+				/* i-- will cause i to be MAXINT. Not good.) */
3d87698
       case '\012':		/* at start of a line, start with -- ? */
3d87698
 	if (i-- && ((c = SNX (bs)) == '-') && i-- && ((c = SNX (bs)) == '-')) {
3d87698
 				/* see if cookie matches */