From 2c09547217bbc6d7f22aa9a41ad23e8028b05cf1 Mon Sep 17 00:00:00 2001 From: shi_peng_tao Date: Thu, 12 May 2022 15:24:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=AC=A6=E5=8F=B7=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7=E5=AF=BC=E8=87=B4=E4=BA=8C=E7=BA=A7=E6=8C=87=E9=92=88?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E9=87=8E=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shi_peng_tao --- common/database/src/idm_database.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/database/src/idm_database.c b/common/database/src/idm_database.c index 5dd296d..2cdab3c 100644 --- a/common/database/src/idm_database.c +++ b/common/database/src/idm_database.c @@ -702,6 +702,7 @@ ResultCode QueryCredentialFromExecutor(uint32_t authType, CredentialInfoHal **cr LOG_ERROR("no memory"); return RESULT_NO_MEMORY; } + *num = 0; LinkedListNode *temp = g_userInfoList->head; while (temp != NULL) { UserInfo *user = (UserInfo *)temp->data; @@ -709,7 +710,7 @@ ResultCode QueryCredentialFromExecutor(uint32_t authType, CredentialInfoHal **cr if (credentialQuery != NULL) { (*num)++; if (*num <= preApplyNum) { - *credentialInfos[*num - 1] = *credentialQuery; + (*credentialInfos)[*num - 1] = *credentialQuery; temp = temp->next; continue; } @@ -731,9 +732,9 @@ ResultCode QueryCredentialFromExecutor(uint32_t authType, CredentialInfoHal **cr } Free(*credentialInfos); *credentialInfos = credentialsTemp; - *credentialInfos[*num - 1] = *credentialQuery; + (*credentialInfos)[*num - 1] = *credentialQuery; } temp = temp->next; } return RESULT_SUCCESS; -} \ No newline at end of file +} -- Gitee