This commit is contained in:
dapan1121 2022-05-23 11:47:39 +08:00
parent 00c7966124
commit 7e1b2b7aad
1 changed files with 5 additions and 2 deletions

View File

@ -1087,9 +1087,12 @@ int32_t catalogGetExpiredUsers(SCatalog* pCtg, SUserAuthVersion **users, uint32_
uint32_t i = 0;
SCtgUserAuth *pAuth = taosHashIterate(pCtg->userCache, NULL);
while (pAuth != NULL) {
void *key = taosHashGetKey(pAuth, NULL);
strncpy((*users)[i].user, key, sizeof((*users)[i].user));
size_t len = 0;
void *key = taosHashGetKey(pAuth, &len);
strncpy((*users)[i].user, key, len);
(*users)[i].user[len] = 0;
(*users)[i].version = pAuth->version;
++i;
pAuth = taosHashIterate(pCtg->userCache, pAuth);
}