fix:[TD-32412] unsafe function
This commit is contained in:
parent
473a9f3b45
commit
5a157ab0b1
|
@ -1921,19 +1921,19 @@ TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, cons
|
|||
return NULL;
|
||||
}
|
||||
|
||||
TAOS* taos_connect_l(const char* ip, int ipLen, const char* user, int userLen, const char* pass, int passLen,
|
||||
const char* db, int dbLen, uint16_t port) {
|
||||
char ipStr[TSDB_EP_LEN] = {0};
|
||||
char dbStr[TSDB_DB_NAME_LEN] = {0};
|
||||
char userStr[TSDB_USER_LEN] = {0};
|
||||
char passStr[TSDB_PASSWORD_LEN] = {0};
|
||||
|
||||
tstrncpy(ipStr, ip, TMIN(TSDB_EP_LEN - 1, ipLen));
|
||||
tstrncpy(userStr, user, TMIN(TSDB_USER_LEN - 1, userLen));
|
||||
tstrncpy(passStr, pass, TMIN(TSDB_PASSWORD_LEN - 1, passLen));
|
||||
tstrncpy(dbStr, db, TMIN(TSDB_DB_NAME_LEN - 1, dbLen));
|
||||
return taos_connect(ipStr, userStr, passStr, dbStr, port);
|
||||
}
|
||||
//TAOS* taos_connect_l(const char* ip, int ipLen, const char* user, int userLen, const char* pass, int passLen,
|
||||
// const char* db, int dbLen, uint16_t port) {
|
||||
// char ipStr[TSDB_EP_LEN] = {0};
|
||||
// char dbStr[TSDB_DB_NAME_LEN] = {0};
|
||||
// char userStr[TSDB_USER_LEN] = {0};
|
||||
// char passStr[TSDB_PASSWORD_LEN] = {0};
|
||||
//
|
||||
// tstrncpy(ipStr, ip, TMIN(TSDB_EP_LEN - 1, ipLen));
|
||||
// tstrncpy(userStr, user, TMIN(TSDB_USER_LEN - 1, userLen));
|
||||
// tstrncpy(passStr, pass, TMIN(TSDB_PASSWORD_LEN - 1, passLen));
|
||||
// tstrncpy(dbStr, db, TMIN(TSDB_DB_NAME_LEN - 1, dbLen));
|
||||
// return taos_connect(ipStr, userStr, passStr, dbStr, port);
|
||||
//}
|
||||
|
||||
void doSetOneRowPtr(SReqResultInfo* pResultInfo) {
|
||||
for (int32_t i = 0; i < pResultInfo->numOfCols; ++i) {
|
||||
|
|
|
@ -538,7 +538,7 @@ static int32_t smlParseTableName(SArray *tags, char *childTableName, char *tbnam
|
|||
// handle child table name
|
||||
if (childTableNameLen == tag->keyLen && strncmp(tag->key, tbnameKey, tag->keyLen) == 0) {
|
||||
(void)memset(childTableName, 0, TSDB_TABLE_NAME_LEN);
|
||||
tstrncpy(childTableName, tag->value, TMIN(TSDB_TABLE_NAME_LEN, tag->length));
|
||||
tstrncpy(childTableName, tag->value, TMIN(TSDB_TABLE_NAME_LEN, tag->length + 1));
|
||||
if (tsSmlDot2Underline) {
|
||||
smlStrReplace(childTableName, strlen(childTableName));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue