From 81d5e2746f4ad7fb649d9ee2c102f08fc93ffbd9 Mon Sep 17 00:00:00 2001 From: David Herberth Date: Tue, 7 Jul 2026 10:49:27 +0200 Subject: [PATCH] fix(elf): Fix potential out of bounds panic on invalid section offsets --- CHANGELOG.md | 8 +++++++- symbolic-debuginfo/src/elf.rs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8797b2d94..3f72892ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +**Fixes** + +- Fix potential out of bounds panic on invalid section offsets ([#1013](https://github.com/getsentry/symbolic/pull/1013)) +- Fix a potential panic when locating sections in an elf file. ([#1012](https://github.com/getsentry/symbolic/pull/1012)) + ## 13.8.0 **Features** @@ -28,7 +35,6 @@ **Fixes** - Fix function range to addr/line resolution, this fixes a case where WASM binaries compiled with Emscripten failed to have their source code mappings resolved. (#[1002](https://github.com/getsentry/symbolic/pull/1002)) -- Fix a potential panic when locating sections in an elf file. ([#1012](https://github.com/getsentry/symbolic/pull/1012)) ## 13.6.0 diff --git a/symbolic-debuginfo/src/elf.rs b/symbolic-debuginfo/src/elf.rs index caf4b61b8..9a95a25d8 100644 --- a/symbolic-debuginfo/src/elf.rs +++ b/symbolic-debuginfo/src/elf.rs @@ -683,7 +683,7 @@ impl<'data> ElfObject<'data> { } let size = header.sh_size as usize; - let data = &self.data[offset..][..size]; + let data = &self.data.get(offset..)?.get(..size)?; let section = DwarfSection { data: Cow::Borrowed(data), address: header.sh_addr,