ipc 内源检视问题修复

Signed-off-by: liubb_0516 <liubeibei8@huawei.com>
This commit is contained in:
liubb_0516 2022-03-10 14:44:51 +08:00
parent 4288da767f
commit 57eb799dbd
6 changed files with 28 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -17,6 +17,7 @@
void RpcStartTrace(const char *value)
{
void(value);
return;
}
@ -27,15 +28,21 @@ void RpcFinishTrace(void)
void RpcStartAsyncTrace(const char *value, int32_t traceId)
{
(void)value;
(void)traceId;
return;
}
void RpcFinishAsyncTrace(const char *value, int32_t traceId)
{
(void)value;
(void)traceId;
return;
}
void RpcMiddleTrace(const char *beforeValue, const char *afterValue)
{
(void)beforeValue;
(void)afterValue;
return;
}

View File

@ -61,7 +61,7 @@ static pthread_mutex_t g_connectorMutex = PTHREAD_MUTEX_INITIALIZER;
static BinderConnector *OpenDriver(void)
{
BinderConnector *connector = (BinderConnector *)malloc(sizeof(BinderConnector));
BinderConnector *connector = (BinderConnector *)calloc(1, sizeof(BinderConnector));
if (connector == NULL) {
RPC_LOG_ERROR("ipc open driver malloc failed.");
return NULL;

View File

@ -424,6 +424,10 @@ void DeleteDeathCallback(DeathCallback *deathCallback)
void WaitForProxyInit(SvcIdentity *svc)
{
if (svc == NULL) {
RPC_LOG_ERROR("invalid svc.");
return;
}
RPC_LOG_INFO("ipc skeleton wait for proxy init");
OnFirstStrongRef(svc->handle);
UpdateProtoIfNeed(svc);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1177,7 +1177,7 @@ int16_t *ReadInt16Vector(IpcIo *io, size_t *size)
return NULL;
}
int16_t *val = (int16_t *)malloc((*size) * sizeof(int16_t));
int16_t *val = (int16_t *)calloc(1, (*size) * sizeof(int16_t));
if (val == NULL) {
RPC_LOG_ERROR("IPC malloc failed: %s:%d\n", __FUNCTION__, __LINE__);
return NULL;

View File

@ -19,15 +19,28 @@
int32_t InvokerListenThreadStub(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option, OnRemoteRequest func)
{
(void)code;
(void)data;
(void)reply;
(void)option;
(void)func;
return ERR_NONE;
}
int32_t GetPidAndUidInfoStub(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option)
{
(void)code;
(void)data;
(void)reply;
(void)option;
return ERR_NONE;
}
int32_t GrantDataBusNameStub(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option)
{
(void)code;
(void)data;
(void)reply;
(void)option;
return ERR_NONE;
}