mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-3687 fixed potential replacement of goto reference with data
reference in x86 PIC CALL to fallthru address
This commit is contained in:
parent
c32b6d6bdb
commit
c0c04ff789
2 changed files with 61 additions and 4 deletions
|
@ -303,6 +303,17 @@ public class ReferenceDBManager implements ReferenceManager, ManagerDB, ErrorHan
|
|||
* @return combined reference type, or the newType if unable to combine
|
||||
*/
|
||||
private RefType combineReferenceType(RefType newType, RefType oldType) {
|
||||
// check if types are the same, if same no use doing work replacing reference
|
||||
if (newType == oldType) {
|
||||
return oldType;
|
||||
}
|
||||
// any flow reference should be used over the existing ref to the same location
|
||||
if (newType.isFlow()) {
|
||||
return newType; // allow any new flow ref to replace old type
|
||||
}
|
||||
if (oldType.isFlow()) {
|
||||
return oldType; // always keep flow over new data ref
|
||||
}
|
||||
if (newType == RefType.DATA) {
|
||||
if (oldType.isData()) {
|
||||
return oldType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue