mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Throw in a few more checks in ElfReader
This commit is contained in:
parent
7d0cfbabe7
commit
875e7f0372
1 changed files with 8 additions and 0 deletions
|
@ -262,6 +262,10 @@ void ElfReader::LoadRelocations2(int rel_seg)
|
||||||
}else{
|
}else{
|
||||||
addr_seg = seg;
|
addr_seg = seg;
|
||||||
relocate_to = segmentVAddr[addr_seg];
|
relocate_to = segmentVAddr[addr_seg];
|
||||||
|
if (!Memory::IsValidAddress(relocate_to)) {
|
||||||
|
ERROR_LOG(LOADER, "ELF: Bad address to relocate to: %08x", relocate_to);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if((flag&0x06)==0x00){
|
if((flag&0x06)==0x00){
|
||||||
rel_offset = cmd;
|
rel_offset = cmd;
|
||||||
|
@ -290,6 +294,10 @@ void ElfReader::LoadRelocations2(int rel_seg)
|
||||||
|
|
||||||
|
|
||||||
rel_offset = rel_base+segmentVAddr[off_seg];
|
rel_offset = rel_base+segmentVAddr[off_seg];
|
||||||
|
if (!Memory::IsValidAddress(relocate_to)) {
|
||||||
|
ERROR_LOG(LOADER, "ELF: Bad rel_offset: %08x", rel_offset);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if((flag&0x38)==0x00){
|
if((flag&0x38)==0x00){
|
||||||
lo16 = 0;
|
lo16 = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue