GP-2032: UndefData.getBytes fills one 0 without memspace.

This commit is contained in:
Dan 2024-09-12 13:52:56 -04:00
parent f292bad0ed
commit c5cef9540e

View File

@ -65,8 +65,8 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV
public int getBytes(ByteBuffer buffer, int addressOffset) { public int getBytes(ByteBuffer buffer, int addressOffset) {
DBTraceMemorySpace mem = trace.getMemoryManager().get(this, false); DBTraceMemorySpace mem = trace.getMemoryManager().get(this, false);
if (mem == null) { if (mem == null) {
// TODO: 0-fill instead? Will need to check memory space bounds. buffer.put((byte) 0);
return 0; return 1;
} }
return mem.getViewBytes(program.snap, address.add(addressOffset), buffer); return mem.getViewBytes(program.snap, address.add(addressOffset), buffer);
} }