Skip to content

Commit

Permalink
Check the note names when looking for the GNU build ID on Linux
Browse files Browse the repository at this point in the history
This fixes issue #73
  • Loading branch information
gabrielesvelto committed Feb 28, 2023
1 parent 0ad69de commit b2515fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/linux/ptrace_dumper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,14 @@ impl PtraceDumper {
) -> Option<&'data [u8]> {
if let Some(mut notes) = elf_obj.iter_note_headers(mem_slice) {
while let Some(Ok(note)) = notes.next() {
if note.n_type == elf::note::NT_GNU_BUILD_ID {
if (note.name == "GNU") && (note.n_type == elf::note::NT_GNU_BUILD_ID) {
return Some(note.desc);
}
}
}
if let Some(mut notes) = elf_obj.iter_note_sections(mem_slice, Some(".note.gnu.build-id")) {
while let Some(Ok(note)) = notes.next() {
if note.n_type == elf::note::NT_GNU_BUILD_ID {
if (note.name == "GNU") && (note.n_type == elf::note::NT_GNU_BUILD_ID) {
return Some(note.desc);
}
}
Expand Down

0 comments on commit b2515fa

Please sign in to comment.