Browse code

count unpacked data scanned with cl_scanbuff()

git-svn: trunk@1013

Tomasz Kojm authored on 2004/10/17 08:32:38
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Oct 17 01:28:48 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav: count unpacked data scanned with cl_scanbuff()
4
+
1 5
 Sat Oct 16 20:11:15 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Rudimentary handling of BeMail (BeOS) messages.
... ...
@@ -12,7 +16,7 @@ Sat Oct 16 18:24:33 BST 2004 (njh)
12 12
 Sat Oct 16 17:10:06 BST 2004 (njh)
13 13
 ----------------------------------
14 14
   * libclamav/untar.c:	Handle empty files in the middle of archives, reported
15
-				by René Bellora <rbellora@tecnoaccion.com.ar>
15
+				by René Bellora <rbellora*tecnoaccion.com.ar>
16 16
 
17 17
 Sat Oct 16 14:55:03 BST 2004 (njh)
18 18
 ----------------------------------
... ...
@@ -1066,6 +1066,9 @@ int cli_scanpe(int desc, const char **virname, long int *scanned, const struct c
1066 1066
 		free(tempfile);
1067 1067
 	    }
1068 1068
 
1069
+	    if(scanned)
1070
+		*scanned += dsize / CL_COUNT_PRECISION;
1071
+
1069 1072
 	    ret = cl_scanbuff(dest, dsize, virname, root);
1070 1073
 	    free(section_hdr);
1071 1074
 	    free(src);
... ...
@@ -840,6 +840,9 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int *
840 840
 	    if(!data) {
841 841
 		cli_dbgmsg("VBADir: WARNING: VBA project '%s' decompressed to NULL\n", vba_project->name[i]);
842 842
 	    } else {
843
+		if(scanned)
844
+		    *scanned += data_len / CL_COUNT_PRECISION;
845
+
843 846
 		if(cli_scanbuff(data, data_len, virname, root, CL_TYPE_MSOLE2) == CL_VIRUS) {
844 847
 		    free(data);
845 848
 		    ret = CL_VIRUS;
... ...
@@ -882,6 +885,8 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int *
882 882
 		if(!data) {
883 883
 			cli_dbgmsg("VBADir: WARNING: WM project '%s' macro %d decrypted to NULL\n", vba_project->name[i], i);
884 884
 		} else {
885
+			if(scanned)
886
+			    *scanned += vba_project->length[i] / CL_COUNT_PRECISION;
885 887
 			if(cli_scanbuff(data, vba_project->length[i], virname, root, CL_TYPE_MSOLE2) == CL_VIRUS) {
886 888
 				free(data);
887 889
 				ret = CL_VIRUS;