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

!223 修改ipc序列化接口ReadString

Merge pull request !223 from 赵瑞宁/master
......@@ -658,16 +658,21 @@ bool ReadDouble(IpcIo *io, double *value)
uint8_t *ReadString(IpcIo *io, size_t *len)
{
if (io == NULL || len == NULL) {
RPC_LOG_ERROR("IPC io == NULL || len == NULL failed: %s:%d\n", __FUNCTION__, __LINE__);
return false;
if (io == NULL) {
RPC_LOG_ERROR("IPC io == NULL failed: %s:%d\n", __FUNCTION__, __LINE__);
return NULL;
}
uint32_t value;
bool ret = ReadUint32(io, &value);
if (ret) {
*len = value;
}
if (value > MAX_IO_SIZE) {
if (value > MAX_IO_SIZE) {
return NULL;
}
if (len != NULL) {
*len = value;
}
} else {
RPC_LOG_ERROR("IPC ReadUint32 failed: %s:%d\n", __FUNCTION__, __LINE__);
return NULL;
}
return (uint8_t *)IoPop(io, value + 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册