[core,smartcardlogon] fix warnings

This commit is contained in:
Armin Novak 2023-07-27 10:23:09 +02:00 committed by akallabeth
parent 3612948bad
commit 6c01433f6a
1 changed files with 9 additions and 2 deletions

View File

@ -894,12 +894,19 @@ BOOL smartcard_getCert(const rdpContext* context, SmartcardCertInfo** cert, BOOL
return FALSE; return FALSE;
} }
if (count > UINT32_MAX)
{
WLog_ERR(TAG, "smartcard certificate count %" PRIuz " exceeds UINT32_MAX", count);
return FALSE;
}
if (count > 1) if (count > 1)
{ {
DWORD index; DWORD index = 0;
if (!instance->ChooseSmartcard || if (!instance->ChooseSmartcard ||
!instance->ChooseSmartcard(context->instance, cert_list, count, &index, gateway)) !instance->ChooseSmartcard(context->instance, cert_list, (UINT32)count, &index,
gateway))
{ {
WLog_ERR(TAG, "more than one suitable smartcard certificate was found"); WLog_ERR(TAG, "more than one suitable smartcard certificate was found");
smartcardCertList_Free(cert_list, count); smartcardCertList_Free(cert_list, count);