mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 16:11:29 +00:00
[BOLT][NFC] Check errors from Obj.dynamicEntries
Addresses fuzzer crash Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D121336
This commit is contained in:
parent
83b8878fbb
commit
d16bbc5340
@ -5135,8 +5135,10 @@ Error RewriteInstance::readELFDynamic(ELFObjectFile<ELFT> *File) {
|
||||
"dynamic section sizes should match");
|
||||
|
||||
// Go through all dynamic entries to locate entries of interest.
|
||||
typename ELFT::DynRange DynamicEntries =
|
||||
cantFail(Obj.dynamicEntries(), "error accessing dynamic table");
|
||||
auto DynamicEntriesOrErr = Obj.dynamicEntries();
|
||||
if (!DynamicEntriesOrErr)
|
||||
return DynamicEntriesOrErr.takeError();
|
||||
typename ELFT::DynRange DynamicEntries = DynamicEntriesOrErr.get();
|
||||
|
||||
for (const Elf_Dyn &Dyn : DynamicEntries) {
|
||||
switch (Dyn.d_tag) {
|
||||
|
Loading…
Reference in New Issue
Block a user