Fail gracefully on symbols with an invalid section name
This commit is contained in:
parent
8c6e26005d
commit
70f5905e67
@ -73,7 +73,7 @@ impl SymbolTable {
|
|||||||
.map(|sym| {
|
.map(|sym| {
|
||||||
(
|
(
|
||||||
symstrtab.get(sym.st_name as usize).unwrap().to_string(),
|
symstrtab.get(sym.st_name as usize).unwrap().to_string(),
|
||||||
Symbol::new(&sym, sect_names[sym.st_shndx as usize].to_string()),
|
Symbol::new(&sym, sect_names.get(sym.st_shndx as usize).map_or_else(|| "UNKNOWN".to_string(), |x| x.to_string())),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect::<HashMap<_, _>>();
|
.collect::<HashMap<_, _>>();
|
||||||
|
Loading…
Reference in New Issue
Block a user