Merge pull request #7091 from taosdata/fix/TD-5539

[TD-5539]<fix> fix core dump caused by unsupport query statement
This commit is contained in:
Haojun Liao 2021-08-02 17:00:35 +08:00 committed by GitHub
commit ce40d1217a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 58 additions and 57 deletions

View File

@ -2790,7 +2790,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;
}