mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0: Guard the buffer truncation with Reason.EXECUTE_DECODE
This commit is contained in:
parent
88d0110a09
commit
deaa24a496
1 changed files with 12 additions and 6 deletions
|
@ -185,12 +185,18 @@ public class BytesPcodeExecutorStateSpace<B> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<ULongSpan> it =
|
/**
|
||||||
uninitialized.complement(ULongSpan.extent(offset, size)).iterator();
|
* The decoder will buffer ahead, so give it as much as we can, but no more than is actually
|
||||||
if (it.hasNext()) {
|
* initialized. If it's a (non-decode) read, give it everything, but invoke the warning.
|
||||||
ULongSpan init = it.next();
|
*/
|
||||||
if (init.min().longValue() == offset) {
|
if (reason == Reason.EXECUTE_DECODE) {
|
||||||
return readBytes(offset, (int) init.length(), reason);
|
Iterator<ULongSpan> it =
|
||||||
|
uninitialized.complement(ULongSpan.extent(offset, size)).iterator();
|
||||||
|
if (it.hasNext()) {
|
||||||
|
ULongSpan init = it.next();
|
||||||
|
if (init.min().longValue() == offset) {
|
||||||
|
return readBytes(offset, (int) init.length(), reason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue