X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fmalware.c;h=bb8f2bcc0a95ef2dce6380eb3ef5e1c2394a34e7;hb=11b31159ac7d1acef923c29053fc3d9c6bbf5c12;hp=069a544833f95b55b8dd096fd6f1c7664c3229b9;hpb=059f2aced50773fa38661a5a30c54260aee4bf55;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/malware.c b/src/src/malware.c index 069a54483..bb8f2bcc0 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -106,16 +106,16 @@ static struct scan void features_malware(void) { -const struct scan * sc; const uschar * s; uschar * t; uschar buf[64]; spf(buf, sizeof(buf), US"_HAVE_MALWARE_"); -for (sc = m_scans; sc->scancode != -1; sc++) +for (const struct scan * sc = m_scans; sc->scancode != -1; sc++) { - for(s = sc->name, t = buf+14; *s; s++) if (*s != '-') *t++ = toupper(*s); + for (s = sc->name, t = buf+14; *s; s++) if (*s != '-') + *t++ = toupper(*s); *t = '\0'; builtin_macro_create(buf); } @@ -897,7 +897,6 @@ badseek: err = errno; /* "virus(es) found" if virus number is > 0 */ if (drweb_vnum) { - int i; gstring * g = NULL; /* setup default virus name */ @@ -908,7 +907,7 @@ badseek: err = errno; drweb_re = m_pcre_compile(drweb_re_str, &errstr); /* read and concatenate virus names into one string */ - for (i = 0; i < drweb_vnum; i++) + for (int i = 0; i < drweb_vnum; i++) { int ovector[10*3]; @@ -1043,7 +1042,7 @@ badseek: err = errno; #ifndef DISABLE_MAL_FSECURE case M_FSEC: /* "fsecure" scanner type ---------------------------------- */ { - int i, j, bread = 0; + int i, bread = 0; uschar * file_name; uschar av_buffer[1024]; static uschar *cmdopt[] = { US"CONFIGURE\tARCHIVE\t1\n", @@ -1069,7 +1068,7 @@ badseek: err = errno; return m_panic_defer_3(scanent, CUS callout_address, string_sprintf("unable to read answer %d (%s)", i, strerror(errno)), malware_daemon_ctx.sock); - for (j = 0; j < bread; j++) + for (int j = 0; j < bread; j++) if (av_buffer[j] == '\r' || av_buffer[j] == '\n') av_buffer[j] ='@'; } @@ -1573,6 +1572,7 @@ badseek: err = errno; * on both connections (as one host could resolve to multiple ips) */ for (;;) { + /*XXX we trust that the cmd_str is ideempotent */ if ((malware_daemon_ctx.sock = m_tcpsocket(cd->hostspec, cd->tcp_port, &connhost, &errstr, &cmd_str)) >= 0) { @@ -2280,9 +2280,8 @@ if (!fprot6d_re_virus) void malware_show_supported(FILE * f) { -struct scan * sc; fprintf(f, "Malware:"); -for (sc = m_scans; sc->scancode != (scanner_t)-1; sc++) fprintf(f, " %s", sc->name); +for (struct scan * sc = m_scans; sc->scancode != (scanner_t)-1; sc++) fprintf(f, " %s", sc->name); fprintf(f, "\n"); }