mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
Unknown conditions cause index out of bounds error leading to a
null pointer deref. this patch returns null instead of bad index out of bounds read and a null pointer check. This would trigger on an action in a table that has only an assign
This commit is contained in:
parent
ac474530f4
commit
af7bdb78d9
2 changed files with 6 additions and 1 deletions
|
@ -50,6 +50,8 @@ public class OperandValue extends PatternValue {
|
|||
|
||||
@Override
|
||||
public TokenPattern genMinPattern(VectorSTL<TokenPattern> ops) {
|
||||
if (index >= ops.size())
|
||||
return null;
|
||||
return ops.get(index);
|
||||
}
|
||||
|
||||
|
|
|
@ -542,7 +542,10 @@ public class Constructor {
|
|||
}
|
||||
}
|
||||
else if (defexp != null) {
|
||||
oppattern.push_back(defexp.genMinPattern(oppattern));
|
||||
TokenPattern tmppat = defexp.genMinPattern(oppattern);
|
||||
if (null == tmppat)
|
||||
throw new SleighError("operand " + sym.getName() + " has an issue", location);
|
||||
oppattern.push_back(tmppat);
|
||||
}
|
||||
else {
|
||||
throw new SleighError("operand " + sym.getName() + " is undefined", location);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue