fix coverity 290758, 267837
This commit is contained in:
parent
8fb948ab49
commit
fbf249f28c
|
@ -2150,7 +2150,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
|
||||||
SSqlRes *pRes = &pSql->res;
|
SSqlRes *pRes = &pSql->res;
|
||||||
|
|
||||||
SCMConnectRsp *pConnect = (SCMConnectRsp *)pRes->pRsp;
|
SCMConnectRsp *pConnect = (SCMConnectRsp *)pRes->pRsp;
|
||||||
strcpy(pObj->acctId, pConnect->acctId); // copy acctId from response
|
tstrncpy(pObj->acctId, pConnect->acctId, sizeof(pObj->acctId)); // copy acctId from response
|
||||||
int32_t len = sprintf(temp, "%s%s%s", pObj->acctId, TS_PATH_DELIMITER, pObj->db);
|
int32_t len = sprintf(temp, "%s%s%s", pObj->acctId, TS_PATH_DELIMITER, pObj->db);
|
||||||
|
|
||||||
assert(len <= sizeof(pObj->db));
|
assert(len <= sizeof(pObj->db));
|
||||||
|
@ -2172,7 +2172,7 @@ int tscProcessUseDbRsp(SSqlObj *pSql) {
|
||||||
STscObj * pObj = pSql->pTscObj;
|
STscObj * pObj = pSql->pTscObj;
|
||||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
||||||
|
|
||||||
strcpy(pObj->db, pTableMetaInfo->name);
|
tstrncpy(pObj->db, pTableMetaInfo->name, sizeof(pObj->db));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ typedef struct {
|
||||||
} SCMConnectMsg;
|
} SCMConnectMsg;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char acctId[TSDB_ACCT_LEN + 1];
|
char acctId[TSDB_ACCT_LEN];
|
||||||
char serverVersion[TSDB_VERSION_LEN];
|
char serverVersion[TSDB_VERSION_LEN];
|
||||||
int8_t writeAuth;
|
int8_t writeAuth;
|
||||||
int8_t superAuth;
|
int8_t superAuth;
|
||||||
|
|
Loading…
Reference in New Issue