Browse code

Fix possible crash when handling file information in corrupted zip archives

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

Tomasz Kojm authored on 2005/01/11 10:34:19
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+Tue Jan 11 02:27:24 CET 2005 (tk)
2
+---------------------------------
3
+  * libclamav/scanners.c: Fix possible crash when handling file information in
4
+			  corrupted zip archives (problem reported by
5
+			  Reinhard Max <max*suse.de>)
6
+
1 7
 Sun Jan  9 21:24:58 GMT 2005 (njh)
2 8
 ----------------------------------
3 9
   * libclamav/mbox.c:	Some HTML.Phishing.Bank-41 were getting through
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2
- *  Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
2
+ *  Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
3 3
  *
4 4
  *  This program is free software; you can redistribute it and/or modify
5 5
  *  it under the terms of the GNU General Public License as published by
... ...
@@ -326,7 +326,7 @@ static int cli_scanzip(int desc, const char **virname, long int *scanned, const
326 326
 	    break;
327 327
 	}
328 328
 
329
-	cli_dbgmsg("Zip: %s, compressed: %u, normal: %u, ratio: %d (max: %d)\n", zdirent.d_name, zdirent.d_csize, zdirent.st_size, zdirent.st_size / (zdirent.d_csize+1), limits ? limits->maxratio : -1 );
329
+	cli_dbgmsg("Zip: %s, compressed: %u, normal: %u, ratio: %d (max: %d)\n", zdirent.d_name, zdirent.d_csize, zdirent.st_size, zdirent.d_csize ? (zdirent.st_size / zdirent.d_csize) : 0, limits ? limits->maxratio : -1 );
330 330
 
331 331
 	if(!zdirent.st_size) {
332 332
 	    files++;