]> git.pld-linux.org Git - packages/procmail.git/blob - procmail-3.22-crash-fix.patch
- release 20, crashfix patch from fedora
[packages/procmail.git] / procmail-3.22-crash-fix.patch
1 diff --git a/src/cstdio.c b/src/cstdio.c
2 index 7b6fe6d..0a0bd5b 100644
3 --- a/src/cstdio.c
4 +++ b/src/cstdio.c
5 @@ -144,7 +144,7 @@ int getbl(p,end)char*p,*end;                                          /* my gets */
6        { case '\n':case EOF:*q='\0';
7            return overflow?-1:p!=q;          /* did we read anything at all? */
8        }
9 -     if(q==end)            /* check here so that a trailing backslash won't be lost */
10 +     if(q>=end)            /* check here so that a trailing backslash won't be lost */
11         q=p,overflow=1;
12       *q++=i;
13     }
14 @@ -199,7 +199,7 @@ int getlline(target,end)char*target,*end;
15            if(*(target=strchr(target,'\0')-1)=='\\')
16             { if(chp2!=target)                            /* non-empty line? */
17                  target++;                    /* then preserve the backslash */
18 -             if(target>end-2)                    /* space enough for getbl? */
19 +             if(target>=end-2)                   /* space enough for getbl? */
20                  target=end-linebuf,overflow=1;         /* toss what we have */
21               continue;
22             }
23 diff --git a/src/formail.c b/src/formail.c
24 index 1f5c9dd..49b9967 100644
25 --- a/src/formail.c
26 +++ b/src/formail.c
27 @@ -219,7 +219,8 @@ static char*getsender(namep,fldp,headreply)char*namep;struct field*fldp;
28    if(i>=0&&(i!=maxindex(sest)||fldp==rdheader))                  /* found anything? */
29     { char*saddr;char*tmp;                           /* determine the weight */
30       nowm=areply&&headreply?headreply==1?sest[i].wrepl:sest[i].wrrepl:i;chp+=j;
31 -     tmp=malloc(j=fldp->Tot_len-j);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
32 +     tmp=malloc((j=fldp->Tot_len-j) + 1);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
33 +     chp[j]='\0';
34       if(sest[i].head==From_)
35        { char*pastad;
36         if(strchr(saddr=chp,'\n'))                   /* multiple From_ lines */
37 @@ -364,7 +365,7 @@ static PROGID;
38  
39  int main(lastm,argv)int lastm;const char*const argv[];
40  { int i,split=0,force=0,bogus=1,every=0,headreply=0,digest=0,nowait=0,keepb=0,
41 -   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart,
42 +   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart=0,
43     berkeley=0,forgetclen;
44    long maxlen,ctlength;FILE*idcache=0;pid_t thepid;
45    size_t j,lnl,escaplen;char*chp,*namep,*escap=ESCAP;
46 diff --git a/src/formisc.c b/src/formisc.c
47 index c48df52..5c2869d 100644
48 --- a/src/formisc.c
49 +++ b/src/formisc.c
50 @@ -66,7 +66,7 @@ inc:     start++;
51  retz:        *target='\0';
52  ret:         return start;
53             }
54 -          if(*start=='\\')
55 +          if(*start=='\\' && *(start + 1))
56               *target++='\\',start++;
57            hitspc=2;
58            goto normal;                                       /* normal word */
This page took 0.080931 seconds and 3 git commands to generate.