]> git.pld-linux.org Git - packages/sendmail.git/blame - sendmail-hprescan-dos.patch
- up to 8.17.1
[packages/sendmail.git] / sendmail-hprescan-dos.patch
CommitLineData
f4355ae1
JR
1diff -urNp -x '*.orig' sendmail-8.16.1.org/sendmail/collect.c sendmail-8.16.1/sendmail/collect.c
2--- sendmail-8.16.1.org/sendmail/collect.c 2020-05-19 21:54:33.000000000 +0200
3+++ sendmail-8.16.1/sendmail/collect.c 2021-10-03 22:30:58.038924399 +0200
ca019133
JB
4@@ -15,6 +15,8 @@
5
f4355ae1 6 #include <sm/sendmail.h>
3b0d3a8f 7
8+#define MAXHDRZ 512
ca019133 9+
ca019133 10 static void eatfrom __P((char *volatile, ENVELOPE *));
03c751e7 11 static void collect_doheader __P((ENVELOPE *));
dd7c6823 12 static SM_FILE_T *collect_dfopen __P((ENVELOPE *));
f4355ae1 13@@ -283,6 +285,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize)
3b0d3a8f 14 register ENVELOPE *e;
03c751e7 15 bool rsetsize;
3b0d3a8f 16 {
17+ int hdrz = 0;
dd7c6823
ER
18 register SM_FILE_T *df;
19 bool ignrdot;
20 int dbto;
f4355ae1 21@@ -612,6 +615,16 @@ nextstate:
3b0d3a8f 22 mstate = MS_BODY;
23 goto nextstate;
24 }
25+
26+ if (hdrz++>MAXHDRZ)
27+ {
28+ sm_syslog(LOG_NOTICE, e->e_id,
29+ "excessive headers from %s during message collect",
30+ CurHostName ? CurHostName : "<local machine>");
31+ errno = 0;
32+ usrerr("451 Stop this. You are lame.");
33+ goto readerr;
34+ }
35
36 /* check for possible continuation line */
37 do
This page took 0.058107 seconds and 4 git commands to generate.