Merge pull request #6479 from taosdata/hotfix/TD-4693

[TD-4693]add null pointer check
This commit is contained in:
haojun Liao 2021-06-15 16:55:12 +08:00 committed by GitHub
commit bbb2a5964f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -879,6 +879,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
return TSDB_CODE_TSC_DISCONNECTED;
}
if (sql == NULL) {
tscError("sql is NULL");
return TSDB_CODE_TSC_APP_ERROR;
}
SSqlObj* pSql = pStmt->pSql;
size_t sqlLen = strlen(sql);