summaryrefslogtreecommitdiff
path: root/security/clamav/files/patch-libclamav__scanners.c_bug_5252
blob: 6a21dedb24ef660986d5eb9636c4301bbbc9c7c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- libclamav/scanners.c.orig
+++ libclamav/scanners.c
@@ -2369,7 +2369,19 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
 		ret = res;
 	    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);
+	    }
 	}
     }