From 44d55a37f37cb0d86d892694fd31bb3403f10ac8 Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Mon, 19 Sep 2022 17:48:28 +0200 Subject: [PATCH] Process compressed files and analyse as much as possible (#8535) - MAGIC_COMPRESS: If the file is compressed, unpack it and look at the contents. - MAGIC_CONTINUE: Return all matches, not just the first. Co-authored-by: Julien Voisin --- projects/file/magic_fuzzer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/file/magic_fuzzer.cc b/projects/file/magic_fuzzer.cc index 4132a109d..7c62962c5 100644 --- a/projects/file/magic_fuzzer.cc +++ b/projects/file/magic_fuzzer.cc @@ -23,7 +23,7 @@ struct Environment { Environment(std::string data_dir) { - magic = magic_open(MAGIC_NONE); + magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE); std::string magic_path = data_dir + "/magic"; if (magic_load(magic, magic_path.c_str())) { fprintf(stderr, "error loading magic file: %s\n", magic_error(magic));