Re: [exim-dev] [exim] ClamAV changes needing testing

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Dr Andrew C Aitchison
CC: exim-dev
Subject: Re: [exim-dev] [exim] ClamAV changes needing testing
On 2010-07-01 at 11:23 +0100, Dr Andrew C Aitchison wrote:
> Hmm.
>
> I've just spotted that my second virus checker is silently failing
> with this executable.


Oh dear. Adding in exim-dev CC.

Looking, I did adjust the logic here, but it should just have been
confirming that there was no truncation (to avoid buffer overrun). I
added extra -d+acl debug statements, so you should be able to see a line
beginning "Malware scan:".

I think I've found it. Before, we had:
(void)string_format(file_name,1024,"%s/scan/%s", spool_directory, message_id);

Clearly I changed too much in one patch, with that clean-up. The rework
to introduce -bmalware left unchanged a variable reference; the %s
construction should be using eml_filename instead of file_name.

Does this fix it for you?


diff --git a/src/src/malware.c b/src/src/malware.c
index f82bef6..6e8b3f3 100644
--- a/src/src/malware.c
+++ b/src/src/malware.c
@@ -1098,7 +1098,8 @@ static int malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking)
             "malware filename does not fit in buffer [malware_internal() cmdline]");
         return DEFER;
         }
-      p = Ustrrchr(eml_filename, '/');
+      Ustrcpy(file_name, eml_filename);
+      p = Ustrrchr(file_name, '/');
       if (p)
         *p = '\0';
       fits = string_format(commandline, sizeof(commandline), CS cmdline_scanner, file_name);