From 9aa1818a47532831bb272483bc2923efaf5749cd Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 18 Oct 2022 11:35:35 +0800 Subject: [PATCH] fix: coverity issues CID: 399614 --- source/common/src/tmisce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/common/src/tmisce.c b/source/common/src/tmisce.c index f1713cfd98..dfaebc99f6 100644 --- a/source/common/src/tmisce.c +++ b/source/common/src/tmisce.c @@ -21,7 +21,8 @@ int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp) { 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, ':'); if (temp) {