[Lldb-commits] [lldb] [lldb][Mach-O] Fix two fuzzer-found hangs/crashes parsing universal Mach-O fat headers (PR #204471)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 17 15:54:32 PDT 2026


================
@@ -0,0 +1,30 @@
+--- !fat-mach-o
+# Regression fixture: a universal (fat) Mach-O whose header claims
+# nfat_arch = 0xFFFFFFFF while the file holds a single arch slice.  The arch
+# loop in ObjectContainerUniversalMachO::ParseHeader used nfat_arch as its
+# bound without checking it against the available data, so this header sent it
+# spinning ~4.29 billion times.  "target create" must instead parse the one
+# real slice and return promptly.  Found by lldb-target-fuzzer.
+FatHeader:
+  magic:           0xCAFEBABF
----------------
bulbazord wrote:

Shouldn't this bee `0xCAFEBABE`?

https://github.com/llvm/llvm-project/pull/204471


More information about the lldb-commits mailing list