string_sprintf("unable to read result (%s)", strerror(errno)),
sock);
- for (p[bread] = '\0'; q = Ustrchr(p, '\n'); p = q+1)
+ for (p[bread] = '\0'; (q = Ustrchr(p, '\n')); p = q+1)
{
*q = '\0';
)
{
int slen = Ustrlen(buf);
- if (slen >= 1)
+ if (slen >= 1)
{
DEBUG(D_acl) debug_printf("got from avast: %s\n", buf);
switch (avast_stage)
if ((malware_name = m_pcre_exec(ava_re_virus, buf)))
{ /* remove backslash in front of [whitespace|backslash] */
uschar * p, * p0;
- for (p = malware_name; *p; ++p)
+ for (p = malware_name; *p; ++p)
if (*p == '\\' && (isspace(p[1]) || p[1] == '\\'))
for (p0 = p; *p0; ++p0) *p0 = p0[1];
-
+
avast_stage = AVA_DONE;
goto endloop;
}
- if (Ustrncmp(buf, "200 SCAN OK", 11) == 0)
+ if (Ustrncmp(buf, "200 SCAN OK", 11) == 0)
{ /* we're done finally */
if (send(sock, "QUIT\n", 5, 0) < 0) /* courtesy */
return m_errlog_defer_3(scanent, string_sprintf(
/* here for any unexpected response from the scanner */
goto endloop;
+
+ case AVA_DONE: log_write(0, LOG_PANIC, "%s:%d:%s: should not happen",
+ __FILE__, __LINE__, __FUNCTION__);
}
}
}
switch(avast_stage)
{
- case AVA_HELO:
+ case AVA_HELO:
case AVA_OPT:
case AVA_RSP: return m_errlog_defer_3(scanent,
nread >= 0