File: 29.patch

package info (click to toggle)
procmail 3.24%2Breally3.22-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,380 kB
  • sloc: ansic: 9,888; sh: 1,920; makefile: 105
file content (25 lines) | stat: -rw-r--r-- 906 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Jan Darmochwal <jdarmochwal@gmx.de>
Subject: formail memory corruption fixes

--- a/src/formail.c
+++ b/src/formail.c
@@ -219,7 +219,7 @@
   if(i>=0&&(i!=maxindex(sest)||fldp==rdheader))		  /* found anything? */
    { char*saddr;char*tmp;			     /* determine the weight */
      nowm=areply&&headreply?headreply==1?sest[i].wrepl:sest[i].wrrepl:i;chp+=j;
-     tmp=malloc(j=fldp->Tot_len-j);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
+     tmp=malloc((j=fldp->Tot_len-j) + 1);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
      if(sest[i].head==From_)
       { char*pastad;
 	if(strchr(saddr=chp,'\n'))		     /* multiple From_ lines */
--- a/src/formisc.c
+++ b/src/formisc.c
@@ -66,7 +66,7 @@
 retz:	      *target='\0';
 ret:	      return start;
 	    }
-	   if(*start=='\\')
+	   if(*start=='\\' && *(start + 1))
 	      *target++='\\',start++;
 	   hitspc=2;
 	   goto normal;					      /* normal word */