X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/4328fd3cb019281becab844b6bf560632b1d34b1..1ac6b2e7857d7b6645dbd09047c4c2ac3b6cef1d:/src/src/malware.c diff --git a/src/src/malware.c b/src/src/malware.c index 7de913f49..994c62993 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -1214,7 +1214,7 @@ static int malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) sizeof(sophie_options_buffer))) == NULL) { /* no options supplied, use default options */ sophie_options = sophie_options_default; - }; + } /* open the sophie socket */ sock = socket(AF_UNIX, SOCK_STREAM, 0); @@ -1249,14 +1249,14 @@ static int malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) DEBUG(D_acl) debug_printf("Malware scan: issuing %s scan [%s]\n", scanner_name, sophie_options); - if (write(sock, file_name, Ustrlen(file_name)) < 0) { + if ( write(sock, file_name, Ustrlen(file_name)) < 0 + || write(sock, "\n", 1) != 1 + ) { (void)close(sock); log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: unable to write to sophie UNIX socket (%s)", sophie_options); return DEFER; - }; - - (void)write(sock, "\n", 1); + } /* wait for result */ memset(av_buffer, 0, sizeof(av_buffer)); @@ -1265,7 +1265,7 @@ static int malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: unable to read from sophie UNIX socket (%s)", sophie_options); return DEFER; - }; + } (void)close(sock); @@ -1283,7 +1283,7 @@ static int malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) else { /* all ok, no virus */ malware_name = NULL; - }; + } } /* ----------------------------------------------------------------------- */