diff --git a/libclamav/clamav.h b/libclamav/clamav.h index 5b2d70ad2..141660f66 100644 --- a/libclamav/clamav.h +++ b/libclamav/clamav.h @@ -139,16 +139,17 @@ struct cl_engine { }; struct cl_limits { + unsigned long int maxscansize; /* during the scanning of archives this size + * will never be exceeded + */ + unsigned long int maxfilesize; /* compressed files will only be decompressed + * and scanned up to this size + */ unsigned int maxreclevel; /* maximum recursion level for archives */ unsigned int maxfiles; /* maximum number of files to be scanned * within a single archive */ - unsigned int maxmailrec; /* maximum recursion level for mail files */ - unsigned int maxratio; /* maximum compression ratio */ unsigned short archivememlim; /* limit memory usage for some unpackers */ - unsigned long int maxfilesize; /* compressed files larger than this limit - * will not be scanned - */ }; struct cl_stat { diff --git a/libclamav/nsis/nulsft.c b/libclamav/nsis/nulsft.c index 7a659c547..ad84a0a2d 100644 --- a/libclamav/nsis/nulsft.c +++ b/libclamav/nsis/nulsft.c @@ -517,10 +517,6 @@ int cli_scannulsft(int desc, cli_ctx *ctx, off_t offset) { struct nsis_st nsist; cli_dbgmsg("in scannulsft()\n"); - if(ctx->limits && ctx->limits->maxreclevel && ctx->arec >= ctx->limits->maxreclevel) { - cli_dbgmsg("Archive recursion limit exceeded (arec == %u).\n", ctx->arec+1); - return CL_EMAXREC; - } memset(&nsist, 0, sizeof(struct nsis_st)); @@ -536,8 +532,6 @@ int cli_scannulsft(int desc, cli_ctx *ctx, off_t offset) { if(cli_leavetemps_flag) cli_dbgmsg("NSIS: Extracting files to %s\n", nsist.dir); - ctx->arec++; - do { ret = cli_nsis_unpack(&nsist, ctx); if(ret != CL_SUCCESS) { @@ -572,7 +566,6 @@ int cli_scannulsft(int desc, cli_ctx *ctx, off_t offset) { free(nsist.dir); - ctx->arec--; return ret; } diff --git a/libclamav/others.h b/libclamav/others.h index e3347e957..5fbd26ce4 100644 --- a/libclamav/others.h +++ b/libclamav/others.h @@ -80,9 +80,9 @@ typedef struct { const struct cli_matcher *root; const struct cl_engine *engine; const struct cl_limits *limits; + unsigned long scansize; unsigned int options; unsigned int arec; - unsigned int mrec; unsigned int found_possibly_unwanted; struct cli_dconf *dconf; } cli_ctx;