From 0b9058162a7e0d98c5dbafcbea83b2eea8a54dc2 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 25 Oct 2023 10:38:57 +0800 Subject: [PATCH] http handle empty packet --- source/libs/transport/src/thttp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 63f07d7493..f1bdd54948 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -293,6 +293,11 @@ int32_t httpSendQuit() { static int32_t taosSendHttpReportImpl(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag) { + if (server == NULL || uri == NULL) { + tError("http-report failed to report to invalid addr"); + return -1; + } + if (pCont == NULL || contLen == 0) { tError("http-report failed to report empty packet"); return -1;