From 29d0e8a59374e77afc498970950870bde4770fd5 Mon Sep 17 00:00:00 2001 From: Simon Kagstrom Date: Thu, 17 Aug 2023 10:51:13 +0200 Subject: [PATCH] macho-parser: Don't support FAT binaries, and warn for it --- src/parsers/macho-parser.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parsers/macho-parser.cc b/src/parsers/macho-parser.cc index 843f1a89..a70c0446 100644 --- a/src/parsers/macho-parser.cc +++ b/src/parsers/macho-parser.cc @@ -256,7 +256,12 @@ class MachoParser : public IFileParser auto hdr = reinterpret_cast(data); // Don't handle big endian machines, or 32-bit binaries - if (hdr->magic == MH_MAGIC_64 || hdr->magic == FAT_MAGIC_64) + if (hdr->magic == FAT_MAGIC_64) + { + error("kcov doesn't support FAT binaries"); + return match_none; + } + if (hdr->magic == MH_MAGIC_64) { return match_perfect; }