dex: Preserve DEX boundaries when member or handler lists are capped (R3.12) (#1388)

Port Craft Anything 34d9450b75f402217a7243c04d6c5ed3d2d3f8d4 reader and opcode decoder.
This commit is contained in:
Afloat authored and Dylan M. Taylor committed 2026-11-17 08:38:14 -05:00
1 parent 77e7878f7b
commit 0373b7f8e3
1 file changed
+4
+4
View File
@@ -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 });