[Pcsclite-git-commit] [PCSC] 02/03: SCardDisconnect(): fix status update for SCARD_UNPOWER_CARD

Ludovic Rousseau rousseau at moszumanska.debian.org
Sat May 13 19:44:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit 8edae1590448eb0519924434f7ba897ceef8d890
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Sat May 13 21:24:40 2017 +0200

    SCardDisconnect(): fix status update for SCARD_UNPOWER_CARD
    
    Store the value returned by IFDPowerICC(, IFD_POWER_DOWN, ).
    This value is then used later to decide if the powering down was a
    success or not and set the card status accordingly.
    
    The problem was detected by pcsc_scan stress code. If a SCardTransmit()
    fails because the card is removed then SCardDisconnect() is called to
    unpower the card.
    Because the card is removed the powering down fails but the card status
    was not correctly updated.
---
 src/winscard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/winscard.c b/src/winscard.c
index 06bc377..47a0e33 100644
--- a/src/winscard.c
+++ b/src/winscard.c
@@ -895,7 +895,7 @@ LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
 		else
 		{
 			/* SCARD_UNPOWER_CARD */
-			IFDPowerICC(rContext, IFD_POWER_DOWN, NULL, NULL);
+			rv = IFDPowerICC(rContext, IFD_POWER_DOWN, NULL, NULL);
 
 			rContext->powerState = POWER_STATE_UNPOWERED;
 			Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list