mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-02 14:50:08 +08:00
GP-0: Guard the buffer truncation with Reason.EXECUTE_DECODE
This commit is contained in:
+6
@@ -185,6 +185,11 @@ public class BytesPcodeExecutorStateSpace<B> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The decoder will buffer ahead, so give it as much as we can, but no more than is actually
|
||||||
|
* initialized. If it's a (non-decode) read, give it everything, but invoke the warning.
|
||||||
|
*/
|
||||||
|
if (reason == Reason.EXECUTE_DECODE) {
|
||||||
Iterator<ULongSpan> it =
|
Iterator<ULongSpan> it =
|
||||||
uninitialized.complement(ULongSpan.extent(offset, size)).iterator();
|
uninitialized.complement(ULongSpan.extent(offset, size)).iterator();
|
||||||
if (it.hasNext()) {
|
if (it.hasNext()) {
|
||||||
@@ -193,6 +198,7 @@ public class BytesPcodeExecutorStateSpace<B> {
|
|||||||
return readBytes(offset, (int) init.length(), reason);
|
return readBytes(offset, (int) init.length(), reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (reason == Reason.EXECUTE_READ) {
|
if (reason == Reason.EXECUTE_READ) {
|
||||||
warnUninit(uninitialized);
|
warnUninit(uninitialized);
|
||||||
|
|||||||
Reference in New Issue
Block a user