From fc905406d52d79266f27fbf0a9d0e96f6c260994 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 4 Dec 2023 14:08:24 +0800 Subject: [PATCH] chore: validate tag val --- source/common/src/tdataformat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index f97f9c0c11..5eebf05596 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -1247,6 +1247,7 @@ static int32_t tPutTagVal(uint8_t *p, STagVal *pTagVal, int8_t isJson) { if (isJson) { n += tPutCStr(p ? p + n : p, pTagVal->pKey); } else { + ASSERTS(pTagVal->cid > 0, "Invalid tag cid %" PRIi16, pTagVal->cid); n += tPutI16v(p ? p + n : p, pTagVal->cid); }