procmail/procmail-3.22-coverity-scan-fixes.patch

87 lines
2.7 KiB
Diff
Raw Permalink Normal View History

diff --git a/src/cstdio.c b/src/cstdio.c
index 0a0bd5b..306a973 100644
--- a/src/cstdio.c
+++ b/src/cstdio.c
@@ -15,6 +15,7 @@ static /*const*/char rcsid[]=
#include "variables.h"
#include "shell.h"
#include "cstdio.h"
+#include "common.h"
static uchar rcbuf[STDBUF],*rcbufp,*rcbufend; /* buffer for custom stdio */
static off_t blasttell;
diff --git a/src/foldinfo.c b/src/foldinfo.c
index 10fe406..d05ad84 100644
--- a/src/foldinfo.c
+++ b/src/foldinfo.c
@@ -18,6 +18,7 @@ static /*const*/char rcsid[]=
#include "goodies.h"
#include "locking.h"
#include "foldinfo.h"
+#include "acommon.h"
static const char
maildirtmp[]=MAILDIRtmp,maildircur[]=MAILDIRcur;
@@ -186,8 +187,8 @@ int screenmailbox(chp,egid,Deliverymode)
if(!stat(buf,&stbuf))
{ unsigned wwsdir;
accspooldir=(wwsdir= /* world writable spool dir? */
- ((S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH)&stbuf.st_mode)==
- (S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH)
+ (((S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH)&stbuf.st_mode)==
+ (S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH))
<<1| /* note it in bit 1 */
uid==stbuf.st_uid); /* we own the spool dir, note it in bit 0 */
if((CAN_toggle_sgid||accspooldir)&&privileged)
diff --git a/src/lmtp.c b/src/lmtp.c
index 2c5b676..2bfacc4 100644
--- a/src/lmtp.c
+++ b/src/lmtp.c
@@ -51,7 +51,7 @@ static int lreaddyn P((void));
int childserverpid;
-static ctopfd;
+static int ctopfd;
static char*overread;
static size_t overlen;
diff --git a/src/locking.c b/src/locking.c
index 572719b..5740c2d 100644
--- a/src/locking.c
+++ b/src/locking.c
@@ -95,7 +95,10 @@ faillock: nlog("Lock failure on");logqnl(name);
permanent=nfsTRY;
ds: ssleep((unsigned)locksleep);
ce: if(nextexit)
-term: { free(name); /* drop the preallocated buffer */
+term: {
+ if(nextexit)
+ elog(whilstwfor),elog("lockfile"),logqnl(name);
+ free(name); /* drop the preallocated buffer */
break;
}
}
@@ -103,7 +106,7 @@ term: { free(name); /* drop the preallocated buffer */
setegid(gid); /* we put back our regular permissions */
lcking&=~lck_DELAYSIG;
if(nextexit)
- elog(whilstwfor),elog("lockfile"),logqnl(name),Terminate();
+ Terminate();
return !!*lockp;
}
diff --git a/src/mailfold.c b/src/mailfold.c
index 6c8bcf4..23b8ac2 100644
--- a/src/mailfold.c
+++ b/src/mailfold.c
@@ -378,7 +378,7 @@ void concon(ch)const int ch; /* flip between concatenated and split fields */
}
}
-void readmail(rhead,tobesent)const long tobesent;
+void readmail(rhead,tobesent)int rhead;const long tobesent;
{ char*chp,*pastend;static size_t contlengthoffset;
;{ long dfilled;
if(rhead==2) /* already read, just examine what we have */