Comment 26 for bug 1015405

The patch did not compile for me. This patch did:

diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index e84d735..1055b2c 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -2369,7 +2369,19 @@ static int magic_scandesc(int desc, cli_ctx *ctx, cli_file_t type)
      ctx->fmap--;
      cli_bitset_free(ctx->hook_lsig_matches);
      ctx->hook_lsig_matches = old_hook_lsig_matches;
- ret_from_magicscan(ret);
+ /* Same switch as end of magic_scandesc function */
+ switch(ret) {
+ case CL_EFORMAT:
+ case CL_EMAXREC:
+ case CL_EMAXSIZE:
+ case CL_EMAXFILES:
+ cli_dbgmsg("Descriptor: %s\n", cl_strerror(ret));
+ case CL_CLEAN: /* here, only from cli_checkfp() */
+ cache_add(hash, hashed_size, ctx);
+ ret_from_magicscan(CL_CLEAN);
+ default:
+ ret_from_magicscan(ret);
+ }
  }
     }