From bed01128bb08eab8f34468f182928408dc5b9137 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 30 Dec 2022 18:03:01 +0800 Subject: [PATCH] fix:json parse error --- source/client/src/clientSmlJson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c index bff4f49735..31b0ed455b 100644 --- a/source/client/src/clientSmlJson.c +++ b/source/client/src/clientSmlJson.c @@ -342,8 +342,8 @@ int smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset){ (*start)++; } - if(unlikely(index != OTD_JSON_FIELDS_NUM)) { - uError("elements != %d", OTD_JSON_FIELDS_NUM) + if(unlikely(index != OTD_JSON_FIELDS_NUM) || element->tags == NULL || element->cols == NULL || element->measure == NULL || element->timestamp == NULL) { + uError("elements != %d or element parse null", OTD_JSON_FIELDS_NUM) return -1; } return 0; -- GitLab