Skip to content

Commit 548fdda

Browse files
committed
Truncate requested section names to 16 bytes when importing DWARF info from a Mach-O
1 parent 7309909 commit 548fdda

File tree

1 file changed

+3
-1
lines changed
  • plugins/dwarf/shared/src

1 file changed

+3
-1
lines changed

plugins/dwarf/shared/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>(
177177
endian,
178178
))
179179
}
180-
} else if let Some(section) = view.section_by_name("__".to_string() + &section_name[1..]) {
180+
}
181+
// Truncate Mach-O section names to 16 bytes
182+
else if let Some(section) = view.section_by_name("__".to_string() + &section_name[1..section_name.len().min(15)]) {
181183
Ok(EndianRcSlice::new(
182184
Rc::from(view.read_vec(section.start(), section.len()).as_slice()),
183185
endian,

0 commit comments

Comments
 (0)