Skip to content

Commit afa9a63

Browse files
committed
Fix crash when parsing DWARF with terminating FDE in .eh_frame
1 parent de5fdb3 commit afa9a63

File tree

1 file changed

+6
-0
lines changed
  • rust/examples/dwarf/dwarf_import/src

1 file changed

+6
-0
lines changed

rust/examples/dwarf/dwarf_import/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ fn parse_eh_frame<R: Reader>(
287287
continue;
288288
}
289289
};
290+
291+
if fde.len() == 0 {
292+
// This FDE is a terminator
293+
return Ok(cie_data_offsets);
294+
}
295+
290296
// Store CIE offset for FDE range
291297
cie_data_offsets.insert(
292298
fde.initial_address()..fde.initial_address()+fde.len(),

0 commit comments

Comments
 (0)