summaryrefslogtreecommitdiff
path: root/src/src/malware.c
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2017-04-29 13:28:38 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2017-04-29 13:28:38 +0100
commitd315eda12f25ca2f72ca56b777a427c9ee7188e1 (patch)
tree47c18d3e1d8f863c98b202d4133a009b0c536ee8 /src/src/malware.c
parent41720de55405891bbc8e7c3388598b9736abe902 (diff)
downloadexim4-d315eda12f25ca2f72ca56b777a427c9ee7188e1.tar.gz
tidying: coverity fixes
Diffstat (limited to 'src/src/malware.c')
-rw-r--r--src/src/malware.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/src/malware.c b/src/src/malware.c
index e995f47b4..94a271b47 100644
--- a/src/src/malware.c
+++ b/src/src/malware.c
@@ -605,7 +605,8 @@ if (!malware_ok)
if ((fsize = lseek(drweb_fd, 0, SEEK_END)) == -1)
{
- int err = errno;
+ int err;
+badseek: err = errno;
(void)close(drweb_fd);
return m_errlog_defer_3(scanent, NULL,
string_sprintf("can't seek spool file %s: %s",
@@ -622,7 +623,8 @@ if (!malware_ok)
sock);
}
drweb_slen = htonl(fsize);
- lseek(drweb_fd, 0, SEEK_SET);
+ if (lseek(drweb_fd, 0, SEEK_SET) < 0)
+ goto badseek;
DEBUG(D_acl) debug_printf_indent("Malware scan: issuing %s remote scan [%s]\n",
scanner_name, scanner_options);
@@ -1478,7 +1480,8 @@ if (!malware_ok)
}
if ((fsize = lseek(clam_fd, 0, SEEK_END)) < 0)
{
- int err = errno;
+ int err;
+b_seek: err = errno;
CLOSE_SOCKDATA; (void)close(clam_fd);
return m_errlog_defer_3(scanent, NULL,
string_sprintf("can't seek spool file %s: %s",
@@ -1494,7 +1497,8 @@ if (!malware_ok)
eml_filename),
sock);
}
- lseek(clam_fd, 0, SEEK_SET);
+ if (lseek(clam_fd, 0, SEEK_SET) < 0)
+ goto b_seek;
if (!(clamav_fbuf = US malloc(fsize_uint)))
{