From fcfddad5532a433a905f909c7e27afb56a933367 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 9 Jan 2023 15:16:19 +0800 Subject: [PATCH] fix(query): fix coredump in calculateOperatorProfResults --- src/query/src/qExecutor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index ff80a36773..6e79eb1fa5 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4966,8 +4966,10 @@ static void doOperatorExecProfOnce(SOperatorStackItem* item, SQueryProfEvent* ev } void calculateOperatorProfResults(SQInfo* pQInfo) { - if (pQInfo->summary.queryProfEvents == NULL) { - qDebug("QInfo:0x%" PRIx64 " query prof events array is null", pQInfo->qId); + if (pQInfo->summary.queryProfEvents == NULL || + pQInfo->summary.queryProfEvents->pData == NULL || + pQInfo->summary.queryProfEvents->size == 0) { + qDebug("QInfo:0x%" PRIx64 " query prof events array is null or array data invalid", pQInfo->qId); return; } -- GitLab