procmail/procmail-3.24-coverity-scan-fixes.patch
Jaroslav Škarvada 604541db2e Switched to the github fork
New version
  Resolves: rhbz#2143702
2023-01-19 23:54:26 +01:00

74 lines
2.2 KiB
Diff

diff --git a/src/cstdio.c b/src/cstdio.c
index d444057..5327c77 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 48b83e2..88d6228 100644
--- a/src/foldinfo.c
+++ b/src/foldinfo.c
@@ -19,6 +19,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,doautoforward)
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 60b7a2d..41e3c1a 100644
--- a/src/lmtp.c
+++ b/src/lmtp.c
@@ -52,7 +52,7 @@ static int lreaddyn P((void));
int childserverpid;
char detaildelim='\0';
-static ctopfd;
+static int ctopfd;
static char*overread;
static size_t overlen;
diff --git a/src/locking.c b/src/locking.c
index a5a0238..c6882ea 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;
}