Browse code

Limit fix

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

Tomasz Kojm authored on 2003/11/16 10:37:00
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sun Nov 16 02:34:12 CET 2003 (tk)
2
+---------------------------------
3
+  * libclamav, clamd: fixed limit initialization when ScanArchive is disabled
4
+		      (thanks to Igor Brezac <igor*ipass.net>)
5
+
1 6
 Sat Nov 15 03:54:39 CET 2003 (tk)
2 7
 ---------------------------------
3 8
   * sigtool: fixed --build problems introduced in 0.65
... ...
@@ -402,6 +402,7 @@ int acceptloop(int socketd, struct cl_node *root, const struct cfgstruct *copt)
402 402
     if(cfgopt(copt, "ScanArchive") || cfgopt(copt, "ClamukoScanArchive")) {
403 403
 
404 404
 	/* set up limits */
405
+	memset(&limits, 0, sizeof(struct cl_limits));
405 406
 
406 407
 	if((cpt = cfgopt(copt, "ArchiveMaxFileSize"))) {
407 408
 	    if((limits.maxfilesize = cpt->numarg))
... ...
@@ -642,7 +642,7 @@ int cli_magic_scandesc(int desc, char **virname, long int *scanned, const struct
642 642
     if(SCAN_ARCHIVE || SCAN_MAIL) {
643 643
         /* Need to examine file type */
644 644
 
645
-	if(limits && limits->maxreclevel)
645
+	if(SCAN_ARCHIVE && limits && limits->maxreclevel)
646 646
 	    if(*reclev > limits->maxreclevel)
647 647
 		return CL_EMAXREC;
648 648