From 3d664817f6ef833a17414a4ecea42004c35cc42f Mon Sep 17 00:00:00 2001 diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c index 8ed4156..449afc3 100644 --- a/libclamav/bytecode.c +++ b/libclamav/bytecode.c @@ -2690,7 +2690,9 @@ int cli_bytecode_runhook(cli_ctx *cctx, const struct cl_engine *engine, struct c cli_dbgmsg("Bytecode %u unpacked file\n", bc->id); lseek(fd, 0, SEEK_SET); cli_dbgmsg("***** Scanning unpacked file ******\n"); + cctx->recursion++; ret = cli_magic_scandesc(fd, cctx); + cctx->recursion--; if (!cctx || !cctx->engine->keeptmp) if (ftruncate(fd, 0) == -1) cli_dbgmsg("ftruncate failed on %d\n", fd); diff --git a/libclamav/bytecode_api.c b/libclamav/bytecode_api.c index 014dcfd..927a765 100644 --- a/libclamav/bytecode_api.c +++ b/libclamav/bytecode_api.c @@ -506,7 +506,9 @@ int32_t cli_bcapi_extract_new(struct cli_bc_ctx *ctx, int32_t id) cli_file_t current = cctx->container_type; if (ctx->containertype != CL_TYPE_ANY) cctx->container_type = ctx->containertype; + cctx->recursion++; res = cli_magic_scandesc(ctx->outfd, cctx); + cctx->recursion--; cctx->container_type = current; if (res == CL_VIRUS) { if (cctx->virname) -- 1.7.2.3