diff -Nur sendmail-8.12.0.orig/sendmail/collect.c sendmail-8.12.0/sendmail/collect.c --- sendmail-8.12.0.orig/sendmail/collect.c Wed Sep 5 00:43:02 2001 +++ sendmail-8.12.0/sendmail/collect.c Mon Sep 24 10:25:42 2001 @@ -15,6 +15,8 @@ SM_RCSID("@(#)$Id$") +#define MAXHDRZ 512 + static void collecttimeout __P((time_t)); static void dferror __P((SM_FILE_T *volatile, char *, ENVELOPE *)); static void eatfrom __P((char *volatile, ENVELOPE *)); @@ -292,6 +294,7 @@ HDR **hdrp; register ENVELOPE *e; { + int hdrz = 0; register SM_FILE_T *volatile df; volatile bool ignrdot; volatile time_t dbto; @@ -582,6 +585,16 @@ mstate = MS_BODY; goto nextstate; } + + if (hdrz++>MAXHDRZ) + { + sm_syslog(LOG_NOTICE, e->e_id, + "excessive headers from %s during message collect", + CurHostName ? CurHostName : ""); + errno = 0; + usrerr("451 Stop this. You are lame."); + goto readerr; + } /* check for possible continuation line */ do