From 0373b7f8e347bd4f284a0522365b19520547495c Mon Sep 17 00:00:00 2001 From: Afloat Date: Tue, 17 Nov 2026 08:38:14 -0500 Subject: [PATCH] dex: Preserve DEX boundaries when member or handler lists are capped (R3.12) (#1388) Port Craft Anything 34d9450b75f402217a7243c04d6c5ed3d2d3f8d4 reader and opcode decoder. --- crates/dex/src/dex.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/dex/src/dex.rs b/crates/dex/src/dex.rs index 6b23d2e78..c4076dfc8 100644 --- a/crates/dex/src/dex.rs +++ b/crates/dex/src/dex.rs @@ -523,6 +523,9 @@ impl<'a> Dex<'a> { } } } + if count > MAX_MEMBERS as u32 { + return cd; + } } cd.complete = true; cd @@ -563,6 +566,7 @@ impl<'a> Dex<'a> { handlers.push(Handler { exception: Some(self.type_desc(t as u32)), address: addr as u32 }); } if size <= 0 + && handlers.len() as u64 == size.unsigned_abs() && let Some((addr, _)) = r.uleb128(p) { handlers.push(Handler { exception: None, address: addr as u32 });