From: Tero Marttila 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; }