From d729dd19ca4d7428db42173fd2f6bf354e48feea Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Thu, 10 Nov 2022 13:34:58 -0500 Subject: [PATCH] GP-2820 corrected getPossibleCalledDestructors NPE --- .../classrecovery/RecoveredClassHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java index e4c4101dbc..d513aacc11 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java @@ -6786,10 +6786,13 @@ public class RecoveredClassHelper { // the operator delete or if there is no vftable ref, the call is before // the operator delete call Function calledFunction = addressToFunctionCallMap.get(callingAddress); - if (calledFunction.isThunk()) { - calledFunction.getThunkedFunction(true); + if (calledFunction != null) { + if (calledFunction.isThunk()) { + // TODO: should all thunks and real function be returned? + calledFunction.getThunkedFunction(true); + } + possibleCalledDestructorSet.add(calledFunction); } - possibleCalledDestructorSet.add(calledFunction); } List possibleCalledDestructors = new ArrayList(possibleCalledDestructorSet);