From ca89dc0b2ed7dab0c73f6893b058a19837d61c8d Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 11 Jan 2021 22:53:19 +0800 Subject: [PATCH] [TD-2693]: return TSDB_CODE_MND_TAG_NOT_EXIST if no tags when auto create child table --- src/mnode/src/mnodeTable.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index a5d7729ec4..3ab21dbd12 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -2215,6 +2215,12 @@ static int32_t mnodeDoGetChildTableMeta(SMnodeMsg *pMsg, STableMetaMsg *pMeta) { static int32_t mnodeAutoCreateChildTable(SMnodeMsg *pMsg) { STableInfoMsg *pInfo = pMsg->rpcMsg.pCont; + if (pMsg->rpcMsg.contLen <= sizeof(*pInfo)) { + mError("msg:%p, app:%p table:%s, failed to auto create child table, tags not exist", pMsg, pMsg->rpcMsg.ahandle, + pInfo->tableId); + return TSDB_CODE_MND_TAG_NOT_EXIST; + } + char* p = pInfo->tags; int32_t nameLen = htonl(*(int32_t*) p); p += sizeof(int32_t); -- GitLab