chore: validate tag val

This commit is contained in:
kailixu 2023-12-04 14:22:49 +08:00
parent fc905406d5
commit 7d8864ec89
1 changed files with 2 additions and 1 deletions

View File

@ -1247,8 +1247,8 @@ 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);
ASSERTS(pTagVal->cid > 0, "Invalid tag cid:%" PRIi16, pTagVal->cid);
}
// type
@ -1273,6 +1273,7 @@ static int32_t tGetTagVal(uint8_t *p, STagVal *pTagVal, int8_t isJson) {
n += tGetCStr(p + n, &pTagVal->pKey);
} else {
n += tGetI16v(p + n, &pTagVal->cid);
ASSERTS(pTagVal->cid < 0, "Invalid tag cid:%" PRIi16, pTagVal->cid);
}
// type