diff options
| author | Josh Ferrell <josh@vector35.com> | 2025-02-11 10:45:00 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2025-02-11 10:45:10 -0500 |
| commit | 548fddae184d75f9482ab21104d705a31bdf1143 (patch) | |
| tree | bb531cec8abc9f3a8370b454237972ccd0fc729f /plugins/dwarf | |
| parent | 7309909363541562933755585024428554404294 (diff) | |
Truncate requested section names to 16 bytes when importing DWARF info from a Mach-O
Diffstat (limited to 'plugins/dwarf')
| -rw-r--r-- | plugins/dwarf/shared/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/dwarf/shared/src/lib.rs b/plugins/dwarf/shared/src/lib.rs index f955852b..ea854238 100644 --- a/plugins/dwarf/shared/src/lib.rs +++ b/plugins/dwarf/shared/src/lib.rs @@ -177,7 +177,9 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>( endian, )) } - } else if let Some(section) = view.section_by_name("__".to_string() + §ion_name[1..]) { + } + // Truncate Mach-O section names to 16 bytes + else if let Some(section) = view.section_by_name("__".to_string() + §ion_name[1..section_name.len().min(15)]) { Ok(EndianRcSlice::new( Rc::from(view.read_vec(section.start(), section.len()).as_slice()), endian, |
