respect file size limit in cli_scanmscab()

git-svn: trunk@963
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent 72a1b2408d
commit 52ab317693
  1. 4
      clamav-devel/ChangeLog
  2. 12
      clamav-devel/libclamav/scanners.c

@ -1,3 +1,7 @@
Mon Oct 4 03:09:46 CEST 2004 (tk)
----------------------------------
* libclamav/scanners.c: respect file size limit in cli_scanmscab()
Sun Oct 3 17:04:27 CEST 2004 (tk)
----------------------------------
* libclamav, clamd: use readdir_r when available

@ -656,6 +656,18 @@ static int cli_scanmscab(int desc, const char **virname, long int *scanned, cons
for(cab = base; cab; cab = cab->next) {
for(file = cab->files; file; file = file->next) {
if(limits && limits->maxfilesize && (file->length > (unsigned int) limits->maxfilesize)) {
cli_dbgmsg("MSCAB: %s: Size exceeded (%u, max: %lu)\n", file->filename, file->length, limits->maxfilesize);
if(BLOCKMAX) {
*virname = "MSCAB.ExceededFileSize";
cabd->close(cabd, base);
mspack_destroy_cab_decompressor(cabd);
return CL_VIRUS;
}
continue;
}
tempname = cli_gentemp(tmpdir);
cli_dbgmsg("MSCAB: Extracting data to %s\n", tempname);
if(cabd->extract(cabd, file, tempname)) {

Loading…
Cancel
Save