diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-06-27 15:39:08 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-06-27 15:39:17 -0400 |
| commit | afa9a63059b47544a410b4fbd651041dc798e267 (patch) | |
| tree | f4e02be1eb796c7132ba22c9d2662eb7ae961fd4 /rust/examples | |
| parent | de5fdb36657a8a2ac500e4d924870c052c2941f7 (diff) | |
Fix crash when parsing DWARF with terminating FDE in .eh_frame
Diffstat (limited to 'rust/examples')
| -rw-r--r-- | rust/examples/dwarf/dwarf_import/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs index 1b6420a2..63f5142f 100644 --- a/rust/examples/dwarf/dwarf_import/src/lib.rs +++ b/rust/examples/dwarf/dwarf_import/src/lib.rs @@ -287,6 +287,12 @@ fn parse_eh_frame<R: Reader>( continue; } }; + + if fde.len() == 0 { + // This FDE is a terminator + return Ok(cie_data_offsets); + } + // Store CIE offset for FDE range cie_data_offsets.insert( fde.initial_address()..fde.initial_address()+fde.len(), |
