mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-5199: per review
GP-5199: forgot a bit GP-5199: fix for 0 length
This commit is contained in:
parent
420dd7ce0c
commit
c2224aa538
1 changed files with 13 additions and 3 deletions
|
@ -83,8 +83,18 @@ public class DebugMisc implements StructConverter {
|
|||
actualData =
|
||||
(unicode ? reader.readNextUnicodeString(length) : reader.readNextAsciiString());
|
||||
}
|
||||
else if (length == 0 && !unicode) {
|
||||
actualData = reader.readNextAsciiString();
|
||||
// NB: should be a multiple of 4 per winnt.h
|
||||
// 13 = len(start of struct) + null
|
||||
length = (int) Math.ceil((actualData.length() + 13)/4.0)*4;
|
||||
if (length > DebugDirectory.IMAGE_SIZEOF_DEBUG_DIRECTORY) {
|
||||
length = DebugDirectory.IMAGE_SIZEOF_DEBUG_DIRECTORY;
|
||||
}
|
||||
Msg.warn(this, "Zero length structure - defaulting to " + Integer.toHexString(length));
|
||||
}
|
||||
else {
|
||||
Msg.error(this, "Bad string length " + Integer.toHexString(length));
|
||||
Msg.error(this, "Bad structure length " + Integer.toHexString(length));
|
||||
}
|
||||
|
||||
reader.setPointerIndex(oldIndex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue