From 6a9d94fd97eec570e15c15ce5e2b01848ee60b48 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 22 Jul 2021 14:38:08 +0800 Subject: [PATCH] [TD-5474] fix runtime bug --- src/plugins/http/src/httpGcJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/http/src/httpGcJson.c b/src/plugins/http/src/httpGcJson.c index f33a994465..2d361d3794 100644 --- a/src/plugins/http/src/httpGcJson.c +++ b/src/plugins/http/src/httpGcJson.c @@ -199,7 +199,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, for (int32_t i = dataFields; i >= 0; i--) { httpJsonItemToken(jsonBuf); - if (row[i] == NULL) { + if (row == NULL || i >= num_fields || row[i] == NULL) { httpJsonOriginString(jsonBuf, "null", 4); continue; }