未验证 提交 7102f628 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #18461 from taosdata/fix/coverity_alex

coverity problem fixed
......@@ -744,9 +744,9 @@ void taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8
enum TdTimezone *tsTimezone) {
if (inTimezoneStr == NULL || inTimezoneStr[0] == 0) return;
char *buf = taosMemoryMalloc(strlen(inTimezoneStr) + 1);
buf[strlen(inTimezoneStr)] = 0;
for (int32_t i = 0; i < strlen(inTimezoneStr); i++) {
size_t len = strlen(inTimezoneStr);
char *buf = taosMemoryCalloc(len + 1, 1);
for (int32_t i = 0; i < len; i++) {
if (inTimezoneStr[i] == ' ' || inTimezoneStr[i] == '(') {
buf[i] = 0;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册