From d27dcd5e358daf7c94eae8be77626f3c1ec85d2f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 8 Jun 2020 09:22:50 +0000 Subject: [PATCH] [TD_543] fix coverity scan, cid:267764 --- src/kit/taosdump/taosdump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index 7875ef732c..f03b46ac47 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -117,8 +117,8 @@ typedef struct { } SDbInfo; typedef struct { - char name[TSDB_TABLE_NAME_LEN + 1]; - char metric[TSDB_TABLE_NAME_LEN + 1]; + char name[TSDB_TABLE_NAME_LEN]; + char metric[TSDB_TABLE_NAME_LEN]; } STableRecord; typedef struct { @@ -871,7 +871,7 @@ int32_t taosDumpMetric(char *metric, SDumpArguments *arguments, FILE *fp) { int fd = -1; STableRecord tableRecord; - strcpy(tableRecord.metric, metric); + tstrncpy(tableRecord.metric, metric, TSDB_TABLE_NAME_LEN); sprintf(command, "select tbname from %s", metric); result = taos_query(taos, command); -- GitLab