[TD-5539]<fix> fix core dump caused by unsupport query statement

This commit is contained in:
markswang 2021-07-29 16:46:05 +08:00
parent 8ad7443822
commit d2218cacdf
1 changed files with 58 additions and 57 deletions

View File

@ -2800,7 +2800,8 @@ void tscDequoteAndTrimToken(SStrToken* pToken) {
}
int32_t tscValidateName(SStrToken* pToken) {
if (pToken->type != TK_STRING && pToken->type != TK_ID) {
if (pToken == NULL || pToken->z == NULL ||
(pToken->type != TK_STRING && pToken->type != TK_ID)) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}