diff --git a/ipc/native/src/mock/source/binder_invoker.cpp b/ipc/native/src/mock/source/binder_invoker.cpp index e1ded9bde237b8a582fd51d28c45f304f0582576..72af0d808c283610fceb5b84a0c5f45ca020f2ed 100644 --- a/ipc/native/src/mock/source/binder_invoker.cpp +++ b/ipc/native/src/mock/source/binder_invoker.cpp @@ -452,6 +452,10 @@ void BinderInvoker::OnTransaction(const uint8_t *buffer) } } else { targetObject = IPCProcessSkeleton::GetCurrent()->GetRegistryObject(); + if (targetObject == nullptr) { + ZLOGE(LABEL, "Invalid samgr stub object"); + abort(); + } } MessageParcel reply; MessageOption option;