mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-302 Corrected DataUtilities improper clearing of code units
This commit is contained in:
parent
65d8648420
commit
16b177b2cf
1 changed files with 5 additions and 5 deletions
|
@ -129,6 +129,11 @@ public final class DataUtilities {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clearMode == ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA &&
|
||||||
|
!Undefined.isUndefined(existingDT)) {
|
||||||
|
throw new CodeUnitInsertionException("Could not create Data at address " + addr);
|
||||||
|
}
|
||||||
|
|
||||||
// Check for external reference on pointer
|
// Check for external reference on pointer
|
||||||
if (existingDT instanceof Pointer) {
|
if (existingDT instanceof Pointer) {
|
||||||
// TODO: This can probably be eliminated
|
// TODO: This can probably be eliminated
|
||||||
|
@ -199,11 +204,6 @@ public final class DataUtilities {
|
||||||
private static void checkEnoughSpace(Program program, Address addr, int existingDataLen,
|
private static void checkEnoughSpace(Program program, Address addr, int existingDataLen,
|
||||||
DataTypeInstance dti, ClearDataMode mode) throws CodeUnitInsertionException {
|
DataTypeInstance dti, ClearDataMode mode) throws CodeUnitInsertionException {
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
// int newSize = dti.getLength();
|
|
||||||
// if (newSize <= existingDataLen) {
|
|
||||||
// listing.clearCodeUnits(addr, addr, false);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
try {
|
try {
|
||||||
Address end = addr.addNoWrap(existingDataLen - 1);
|
Address end = addr.addNoWrap(existingDataLen - 1);
|
||||||
Address newEnd = addr.addNoWrap(dti.getLength() - 1);
|
Address newEnd = addr.addNoWrap(dti.getLength() - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue