[Pcsclite-cvs-commit] r3313 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon Feb 9 13:53:53 UTC 2009


Author: rousseau
Date: Mon Feb  9 13:53:52 2009
New Revision: 3313

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3313
Log:
SCardEstablishContextTH(): check we do not reuse an already allocated hContext

Thanks to Daniel Nobs for the bug report and patch
Closes: [#311455] Error in SCardEstablishContext

Modified:
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=3313&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Mon Feb  9 13:53:52 2009
@@ -507,7 +507,7 @@
 		isExecuted = 1;
 	}
 
-
+again:
 	/*
 	 * Try to establish an Application Context with the server
 	 */
@@ -534,6 +534,9 @@
 
 	if (scEstablishStruct.rv != SCARD_S_SUCCESS)
 		return scEstablishStruct.rv;
+
+	if (-1 != SCardGetContextIndiceTH(scEstablishStruct.phContext))
+		goto again;
 
 	*phContext = scEstablishStruct.phContext;
 




More information about the Pcsclite-cvs-commit mailing list