git://git.exim.org
/
users
/
jgh
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2cb629
)
tidying: coverity issues
author
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 3 Mar 2016 22:55:34 +0000
(22:55 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 3 Mar 2016 22:55:34 +0000
(22:55 +0000)
src/src/dcc.c
patch
|
blob
|
history
src/src/dns.c
patch
|
blob
|
history
src/src/exim_dbutil.c
patch
|
blob
|
history
src/src/routers/queryprogram.c
patch
|
blob
|
history
src/src/spam.c
patch
|
blob
|
history
src/src/spool_in.c
patch
|
blob
|
history
src/src/transport.c
patch
|
blob
|
history
src/src/verify.c
patch
|
blob
|
history
diff --git
a/src/src/dcc.c
b/src/src/dcc.c
index b03690ca67f4f34d73e68a9efe48a0b2395bb892..c374cf91ce622ce0fa2f5e19bdb1dbdcbf4d13a3 100644
(file)
--- a/
src/src/dcc.c
+++ b/
src/src/dcc.c
@@
-216,9
+216,9
@@
dcc_process(uschar **listptr)
}
} else {
/* connecting to the dccifd UNIX socket */
}
} else {
/* connecting to the dccifd UNIX socket */
- bzero(
(char *)&serv_addr,
sizeof(serv_addr));
+ bzero(
&serv_addr,
sizeof(serv_addr));
serv_addr.sun_family = AF_UNIX;
serv_addr.sun_family = AF_UNIX;
- Ustr
cpy(serv_addr.sun_path, sockpath
);
+ Ustr
ncpy(serv_addr.sun_path, sockpath, sizeof(serv_addr.sun_path)
);
if ((sockfd = socket(AF_UNIX, SOCK_STREAM,0)) < 0){
DEBUG(D_acl)
debug_printf("DCC: Creating UNIX socket connection failed: %s\n", strerror(errno));
if ((sockfd = socket(AF_UNIX, SOCK_STREAM,0)) < 0){
DEBUG(D_acl)
debug_printf("DCC: Creating UNIX socket connection failed: %s\n", strerror(errno));
diff --git
a/src/src/dns.c
b/src/src/dns.c
index bb6693254cacf4343dec99fcd6470ef5e9890f48..17152d9a6841248cf4e2d55c869b6e23ff9828fc 100644
(file)
--- a/
src/src/dns.c
+++ b/
src/src/dns.c
@@
-868,7
+868,7
@@
BOOL secure_so_far = TRUE;
for (i = 0; i < 10; i++)
{
for (i = 0; i < 10; i++)
{
- uschar
data[256]
;
+ uschar
* data
;
dns_record *rr, cname_rr, type_rr;
dns_scan dnss;
int datalen, rc;
dns_record *rr, cname_rr, type_rr;
dns_scan dnss;
int datalen, rc;
@@
-918,7
+918,7
@@
for (i = 0; i < 10; i++)
/* If any data records of the correct type were found, we are done. */
/* If any data records of the correct type were found, we are done. */
- if (type_rr.data
!= NULL
)
+ if (type_rr.data)
{
if (!secure_so_far) /* mark insecure if any element of CNAME chain was */
dns_set_insecure(dnsa);
{
if (!secure_so_far) /* mark insecure if any element of CNAME chain was */
dns_set_insecure(dnsa);
@@
-930,10
+930,14
@@
for (i = 0; i < 10; i++)
have had a failure from dns_lookup). However code against the possibility of
its not existing. */
have had a failure from dns_lookup). However code against the possibility of
its not existing. */
- if (cname_rr.data == NULL) return DNS_FAIL;
+ if (!cname_rr.data)
+ return DNS_FAIL;
+
+ data = store_get(256);
datalen = dn_expand(dnsa->answer, dnsa->answer + dnsa->answerlen,
datalen = dn_expand(dnsa->answer, dnsa->answer + dnsa->answerlen,
- cname_rr.data, (DN_EXPAND_ARG4_TYPE)data, sizeof(data));
- if (datalen < 0) return DNS_FAIL;
+ cname_rr.data, (DN_EXPAND_ARG4_TYPE)data, 256);
+ if (datalen < 0)
+ return DNS_FAIL;
name = data;
if (!dns_is_secure(dnsa))
name = data;
if (!dns_is_secure(dnsa))
diff --git
a/src/src/exim_dbutil.c
b/src/src/exim_dbutil.c
index 417a42db61905b089b235947d2f790d18b8c1837..262e39044321f4675658e134a3637f39bd0c4ceb 100644
(file)
--- a/
src/src/exim_dbutil.c
+++ b/
src/src/exim_dbutil.c
@@
-259,7
+259,7
@@
uschar buffer[256];
ensures that Exim has exclusive use of the database before it even tries to
open it. If there is a database, there should be a lock file in existence. */
ensures that Exim has exclusive use of the database before it even tries to
open it. If there is a database, there should be a lock file in existence. */
-sprintf(CS buffer, "%s/db/%s.lockfile", spool_directory, name);
+sprintf(CS buffer, "%s/db/%
.200
s.lockfile", spool_directory, name);
dbblock->lockfd = Uopen(buffer, flags, 0);
if (dbblock->lockfd < 0)
dbblock->lockfd = Uopen(buffer, flags, 0);
if (dbblock->lockfd < 0)
diff --git
a/src/src/routers/queryprogram.c
b/src/src/routers/queryprogram.c
index 018e4c831a2d2040108366ff6c1d1a7e49a41ebc..9970c829913540ae1b9c012b47d382ef7819c4af 100644
(file)
--- a/
src/src/routers/queryprogram.c
+++ b/
src/src/routers/queryprogram.c
@@
-214,6
+214,7
@@
ugid.uid_set = ugid.gid_set = FALSE;
/* Set up the propagated data block with the current address_data and the
errors address and extra header stuff. */
/* Set up the propagated data block with the current address_data and the
errors address and extra header stuff. */
+bzero(&addr_prop, sizeof(addr_prop));
addr_prop.address_data = deliver_address_data;
rc = rf_get_errors_address(addr, rblock, verify, &addr_prop.errors_address);
addr_prop.address_data = deliver_address_data;
rc = rf_get_errors_address(addr, rblock, verify, &addr_prop.errors_address);
diff --git
a/src/src/spam.c
b/src/src/spam.c
index 6a0ca3c20b550e7355f580ddcef88a365cba4ad2..51ae88f50585075e54a9a1f0fd92cdb018913b50 100644
(file)
--- a/
src/src/spam.c
+++ b/
src/src/spam.c
@@
-139,7
+139,7
@@
long rnd, weights;
unsigned pri;
static BOOL srandomed = FALSE;
unsigned pri;
static BOOL srandomed = FALSE;
-/* seedup, if we have only 1 server */
+/* s
p
eedup, if we have only 1 server */
if (num_servers == 1)
return (spamds[0]->is_failed ? -1 : 0);
if (num_servers == 1)
return (spamds[0]->is_failed ? -1 : 0);
diff --git
a/src/src/spool_in.c
b/src/src/spool_in.c
index 59192ef30757a4e50adffc200517522d2f15074c..992e088869e05ab48329466324a64e9e3d023a13 100644
(file)
--- a/
src/src/spool_in.c
+++ b/
src/src/spool_in.c
@@
-473,11
+473,13
@@
for (;;)
int index, count;
uschar name[20]; /* Need plenty of space for %d format */
tree_node *node;
int index, count;
uschar name[20]; /* Need plenty of space for %d format */
tree_node *node;
- if (sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2)
+ if ( sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2
+ || index >= 20
+ )
goto SPOOL_FORMAT_ERROR;
if (index < 10)
(void) string_format(name, sizeof(name), "%c%d", 'c', index);
goto SPOOL_FORMAT_ERROR;
if (index < 10)
(void) string_format(name, sizeof(name), "%c%d", 'c', index);
- else
if (index < 20) /* ignore out-of-range index */
+ else
(void) string_format(name, sizeof(name), "%c%d", 'm', index - 10);
node = acl_var_create(name);
node->data.ptr = store_get(count + 1);
(void) string_format(name, sizeof(name), "%c%d", 'm', index - 10);
node = acl_var_create(name);
node->data.ptr = store_get(count + 1);
diff --git
a/src/src/transport.c
b/src/src/transport.c
index 13f3c07fcfc34b214bf8256fe4cc567818f2afd3..c14b60f4e8388007939fc831b8b9373e1024194f 100644
(file)
--- a/
src/src/transport.c
+++ b/
src/src/transport.c
@@
-1205,7
+1205,7
@@
transport_write_message(address_item *addr, int fd, int options,
BOOL use_crlf;
BOOL last_filter_was_NL = TRUE;
int rc, len, yield, fd_read, fd_write, save_errno;
BOOL use_crlf;
BOOL last_filter_was_NL = TRUE;
int rc, len, yield, fd_read, fd_write, save_errno;
-int pfd[2];
+int pfd[2]
= {-1, -1}
;
pid_t filter_pid, write_pid;
transport_filter_timed_out = FALSE;
pid_t filter_pid, write_pid;
transport_filter_timed_out = FALSE;
diff --git
a/src/src/verify.c
b/src/src/verify.c
index 6aa425a5490df5e1fc59f36a1f2371584ccd6192..3d4f885501be6a01e0f2d628e03e58d2e700b9a5 100644
(file)
--- a/
src/src/verify.c
+++ b/
src/src/verify.c
@@
-458,7
+458,7
@@
can do it there for the non-rcpt-verify case. For this we keep an addresscount.
&& port == cutthrough.host.port
)
{
&& port == cutthrough.host.port
)
{
- uschar * resp;
+ uschar * resp
= NULL
;
/* Match! Send the RCPT TO, append the addr, set done */
done =
/* Match! Send the RCPT TO, append the addr, set done */
done =
@@
-485,7
+485,7
@@
can do it there for the non-rcpt-verify case. For this we keep an addresscount.
else
{
cancel_cutthrough_connection("recipient rejected");
else
{
cancel_cutthrough_connection("recipient rejected");
- if (errno == ETIMEDOUT)
+ if (
!resp ||
errno == ETIMEDOUT)
{
HDEBUG(D_verify) debug_printf("SMTP timeout\n");
}
{
HDEBUG(D_verify) debug_printf("SMTP timeout\n");
}