未验证 提交 15364fb1 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #17517 from taosdata/fix/coverity_glzhao

fix: fix coverity issues
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp) { int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp) {
pEp->port = 0; pEp->port = 0;
strcpy(pEp->fqdn, ep); memset(pEp->fqdn, 0, TSDB_FQDN_LEN);
strncpy(pEp->fqdn, ep, TSDB_FQDN_LEN - 1);
char* temp = strchr(pEp->fqdn, ':'); char* temp = strchr(pEp->fqdn, ':');
if (temp) { if (temp) {
......
...@@ -90,8 +90,10 @@ int64_t taosGetIntervalStartTimestamp(int64_t startTime, int64_t slidingTime, in ...@@ -90,8 +90,10 @@ int64_t taosGetIntervalStartTimestamp(int64_t startTime, int64_t slidingTime, in
SName* toName(int32_t acctId, const char* pDbName, const char* pTableName, SName* pName) { SName* toName(int32_t acctId, const char* pDbName, const char* pTableName, SName* pName) {
pName->type = TSDB_TABLE_NAME_T; pName->type = TSDB_TABLE_NAME_T;
pName->acctId = acctId; pName->acctId = acctId;
strcpy(pName->dbname, pDbName); memset(pName->dbname, 0, TSDB_DB_NAME_LEN);
strcpy(pName->tname, pTableName); strncpy(pName->dbname, pDbName, TSDB_DB_NAME_LEN - 1);
memset(pName->tname, 0, TSDB_TABLE_NAME_LEN);
strncpy(pName->tname, pTableName, TSDB_TABLE_NAME_LEN - 1);
return pName; return pName;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册