Package: procmail / 3.22-24

28 Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Tero Marttila <terom@fixme.fi>
Subject: Fix off-by-one error that makes procmail to segfault on certain .procmailrc files

--- a/src/cstdio.c
+++ b/src/cstdio.c
@@ -144,7 +144,7 @@
       { case '\n':case EOF:*q='\0';
 	   return overflow?-1:p!=q;	     /* did we read anything at all? */
       }
-     if(q==end)	    /* check here so that a trailing backslash won't be lost */
+     if(q>=end)	    /* check here so that a trailing backslash won't be lost */
 	q=p,overflow=1;
      *q++=i;
    }
@@ -199,7 +199,7 @@
 	   if(*(target=strchr(target,'\0')-1)=='\\')
 	    { if(chp2!=target)				  /* non-empty line? */
 		 target++;		      /* then preserve the backslash */
-	      if(target>end-2)			  /* space enough for getbl? */
+	      if(target>=end-2)			  /* space enough for getbl? */
 		 target=end-linebuf,overflow=1;		/* toss what we have */
 	      continue;
 	    }