提交 db4f13fa 编写于 作者: S slguan

invalid memory write while authorization failed

上级 3296e30d
...@@ -1333,36 +1333,37 @@ _rsp: ...@@ -1333,36 +1333,37 @@ _rsp:
pRsp->code = code; pRsp->code = code;
pMsg += sizeof(STaosRsp); pMsg += sizeof(STaosRsp);
if (code == 0) { pConnectRsp = (SConnectRsp *)pRsp->more;
pConnectRsp = (SConnectRsp *)pRsp->more; sprintf(pConnectRsp->acctId, "%x", pConn->pAcct->acctId);
sprintf(pConnectRsp->acctId, "%x", pConn->pAcct->acctId); strcpy(pConnectRsp->version, version);
strcpy(pConnectRsp->version, version); pConnectRsp->writeAuth = pConn->writeAuth;
pConnectRsp->writeAuth = pConn->writeAuth; pConnectRsp->superAuth = pConn->superAuth;
pConnectRsp->superAuth = pConn->superAuth; pMsg += sizeof(SConnectRsp);
pMsg += sizeof(SConnectRsp);
int size;
int size; if (pSdbPublicIpList != NULL && pSdbIpList != NULL) {
if (pSdbPublicIpList != NULL && pSdbIpList != NULL) { size = pSdbPublicIpList->numOfIps * 4 + sizeof(SIpList);
size = pSdbPublicIpList->numOfIps * 4 + sizeof(SIpList); if (pConn->usePublicIp) {
if (pConn->usePublicIp) { memcpy(pMsg, pSdbPublicIpList, size);
memcpy(pMsg, pSdbPublicIpList, size);
} else {
memcpy(pMsg, pSdbIpList, size);
}
} else { } else {
SIpList tmpIpList; memcpy(pMsg, pSdbIpList, size);
tmpIpList.numOfIps = 0;
size = tmpIpList.numOfIps * 4 + sizeof(SIpList);
memcpy(pMsg, &tmpIpList, size);
} }
} else {
SIpList tmpIpList;
tmpIpList.numOfIps = 0;
size = tmpIpList.numOfIps * 4 + sizeof(SIpList);
memcpy(pMsg, &tmpIpList, size);
}
pMsg += size; pMsg += size;
// set the time resolution: millisecond or microsecond // set the time resolution: millisecond or microsecond
*((uint32_t *)pMsg) = tsTimePrecision; *((uint32_t *)pMsg) = tsTimePrecision;
pMsg += sizeof(uint32_t); pMsg += sizeof(uint32_t);
} else { if (code != 0) {
pConnectRsp->writeAuth = 0;
pConnectRsp->superAuth = 0;
pConn->pAcct = NULL; pConn->pAcct = NULL;
pConn->pUser = NULL; pConn->pUser = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册