Dont use invalid/bogus input value for cbAtrLen for Smartcard Status Calls, instead just always use the max value here to indicate we have max

buffer space available.
This commit is contained in:
bjcollins 2015-09-18 16:55:06 -05:00
parent d1cb3410de
commit 456416a871
1 changed files with 2 additions and 8 deletions

View File

@ -888,10 +888,7 @@ static LONG smartcard_StatusA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT
LPSTR mszReaderNames = NULL;
IRP* irp = operation->irp;
if (call->cbAtrLen > 32)
call->cbAtrLen = 32;
ret.cbAtrLen = call->cbAtrLen;
ret.cbAtrLen = 32;
ZeroMemory(ret.pbAtr, 32);
cchReaderLen = SCARD_AUTOALLOCATE;
@ -941,10 +938,7 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT
LPWSTR mszReaderNames = NULL;
IRP* irp = operation->irp;
if (call->cbAtrLen > 32)
call->cbAtrLen = 32;
ret.cbAtrLen = call->cbAtrLen;
ret.cbAtrLen = 32;
ZeroMemory(ret.pbAtr, 32);
cchReaderLen = SCARD_AUTOALLOCATE;