git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@670 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/07/14 20:35:38
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Jul 14 13:31:41 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav: fix detection of mail files
4
+
1 5
 Wed Jul 14 11:17:58 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * clamav-milter:	Added --dont-wait and --advisory options
... ...
@@ -6,6 +6,6 @@ includedir=@includedir@
6 6
 Name: libclamav
7 7
 Description: A GPL virus scanner
8 8
 Version: @LIBCLAMAV_VERSION@
9
-Libs: -L${libdir} @LIBCLAMAV_LIBS@
9
+Libs: -L${libdir} -lclamav @LIBCLAMAV_LIBS@
10 10
 Cflags: -I${includedir} @CFLAGS@
11 11
 
... ...
@@ -300,9 +300,10 @@ int cli_scanbuff(const char *buffer, unsigned int length, const char **virname,
300 300
 				if(++partcnt[pt->sigid] == pt->parts) { /* the last one */
301 301
 				    if(pt->type) {
302 302
 					if(typerec) {
303
-					    cli_dbgmsg("Matched signature for file type: %s\n", pt->virname);
304
-					    if(pt->type > type)
303
+					    if(pt->type > type) {
304
+						cli_dbgmsg("Matched signature for file type: %s\n", pt->virname);
305 305
 						type = pt->type;
306
+					    }
306 307
 					}
307 308
 				    } else {
308 309
 					if(virname)
... ...
@@ -317,8 +318,11 @@ int cli_scanbuff(const char *buffer, unsigned int length, const char **virname,
317 317
 		    } else { /* old type signature */
318 318
 			if(pt->type) {
319 319
 			    if(typerec) {
320
-				cli_dbgmsg("Matched signature for file type: %s\n", pt->virname);
321
-				type = pt->type;
320
+				if(pt->type > type) {
321
+				    cli_dbgmsg("Matched signature for file type: %s\n", pt->virname);
322
+
323
+				    type = pt->type;
324
+				}
322 325
 			    }
323 326
 			} else {
324 327
 			    if(virname)
... ...
@@ -89,7 +89,7 @@ static int cli_addsig(struct cl_node *root, const char *virname, const char *hex
89 89
 	    *start++ = 0;
90 90
 
91 91
 	    new->alt++;
92
-	    new->altn = (unsigned short int *) realloc(new->altn, new->alt);
92
+	    new->altn = (unsigned short int *) realloc(new->altn, new->alt * sizeof(unsigned short int));
93 93
 	    new->altn[new->alt - 1] = 0;
94 94
 	    new->altc = (char **) realloc(new->altc, new->alt);
95 95