fix recursion level crash (bb #3706).

Thanks to Stephane Chazelas for the analysis.
remotes/push_mirror/valgrind-mpool
Török Edvin 14 years ago
parent 59f1b78b51
commit 3d664817f6
  1. 4
      ChangeLog
  2. 2
      libclamav/bytecode.c
  3. 2
      libclamav/bytecode_api.c

@ -1,3 +1,7 @@
Sat Oct 8 12:10:13 EEST 2011 (edwin)
-------------------------------------
* libclamav/bytecode.c,bytecode_api.c: fix recursion level crash (bb #3706).
Mon Sep 19 13:44:36 CEST 2011 (tk)
----------------------------------
* freshclam: re-enable short-time blacklisting of mirrors on

@ -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);

@ -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)

Loading…
Cancel
Save