未验证 提交 7ddaf9c3 编写于 作者: O openharmony_ci 提交者: Gitee

!690 fix processskeleton double free problem in fuzz test

Merge pull request !690 from wanghaoxu/master
......@@ -27,7 +27,7 @@ namespace OHOS {
class ProcessSkeleton : public virtual RefBase {
public:
static sptr<ProcessSkeleton> GetInstance();
static ProcessSkeleton* GetInstance();
sptr<IRemoteObject> GetRegistryObject();
void SetRegistryObject(sptr<IRemoteObject> &object);
void SetSamgrFlag(bool flag);
......@@ -43,7 +43,7 @@ private:
ProcessSkeleton() = default;
~ProcessSkeleton();
static sptr<ProcessSkeleton> instance_;
static ProcessSkeleton* instance_;
static std::mutex mutex_;
std::shared_mutex objMutex_;
sptr<IRemoteObject> registryObject_ = nullptr;
......
......@@ -523,7 +523,7 @@ int IPCObjectProxy::GetProtoInfo()
MessageParcel data, reply;
MessageOption option;
int err = SendRequestInner(true, GET_PROTO_INFO, data, reply, option);
if (err != ERR_NONE) {
if (err != ERR_NONE && err != -EBADMSG) {
ZLOGW(LABEL, "GET_PROTO_INFO transact return error = %{public}d", err);
return IRemoteObject::IF_PROT_ERROR;
}
......
......@@ -22,10 +22,10 @@
namespace OHOS {
static constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = { LOG_CORE, LOG_ID_IPC, "ProcessSkeleton" };
sptr<ProcessSkeleton> ProcessSkeleton::instance_ = nullptr;
ProcessSkeleton* ProcessSkeleton::instance_ = nullptr;
std::mutex ProcessSkeleton::mutex_;
sptr<ProcessSkeleton> ProcessSkeleton::GetInstance()
ProcessSkeleton* ProcessSkeleton::GetInstance()
{
if (instance_ == nullptr) {
std::lock_guard<std::mutex> lockGuard(mutex_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册