Fixes VxWorksSymTab_Finder.java edge case

Fixes MemoryAccessException that occurs if a candidate entry goes into invalid memory.
This commit is contained in:
Ben Demick
2025-04-17 16:35:37 -04:00
committed by GitHub
parent 2abfd4e309
commit 45b91b1818

View File

@@ -415,7 +415,12 @@ public class VxWorksSymTab_Finder extends GhidraScript {
// Test is weak.
//------------------------------------------------------------------------
private boolean isSymTblEntry(Address entry, VxSymbol vxSymbol) throws Exception {
// Make sure there's data for the symbol
if ( !isAddress(entry.getOffset() + vxSymbol.length() - 1) ) {
return false;
}
// First dword must be null or a valid ptr (typically into the sym table)
long value = getInt(entry) & 0xffffffffL;
if ((value != 0) && !isAddress(value)) {