mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-06 06:35:29 -04:00
structs redesigned
git-svn-id: file:///var/lib/svn/clamav-devel/branches/newlimits@3550 77e5149b-7576-45b1-b177-96237e5ba77b
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user