From e169d19dd4aef8b3192bafe9bb5c657a9b4553e3 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 18 Jun 2022 21:08:12 +0800 Subject: [PATCH] fix:heap overflow in comment --- source/common/src/tmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 7813c0c3ab..c3c96972b7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -707,7 +707,7 @@ int32_t tDeserializeSMAlterStbReq(void *buf, int32_t bufLen, SMAlterStbReq *pReq if (tDecodeI32(&decoder, &pReq->ttl) < 0) return -1; if (tDecodeI32(&decoder, &pReq->commentLen) < 0) return -1; if (pReq->commentLen > 0) { - pReq->comment = taosMemoryMalloc(pReq->commentLen); + pReq->comment = taosMemoryMalloc(pReq->commentLen + 1); if (pReq->comment == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->comment) < 0) return -1; }