[Pcsclite-git-commit] [PCSC] 04/04: Initialize readerStates[].eventCounter to 0
Ludovic Rousseau
rousseau at moszumanska.debian.org
Fri Jun 26 15:39:56 UTC 2015
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository PCSC.
commit adacc765364284840762da3867e9cab7e3eb2b92
Author: Ludovic Rousseau <ludovic.rousseau at gmail.com>
Date: Fri Jun 26 15:17:35 2015 +0200
Initialize readerStates[].eventCounter to 0
The field readerStates[].eventCounter was not initialized. It was not a
real problem since the exact value is not used, only a value increment
is used.
The only problematic case was if readerStates[].eventCounter value is
greater than 2^16. In that case the function SCardGetStatusChange() is
no more able to detect card movement and would return immediatly.
See also the previous patch.
Thanks to Alan for the bug report.
---
src/readerfactory.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/readerfactory.c b/src/readerfactory.c
index ba4acec..fc5b5ff 100644
--- a/src/readerfactory.c
+++ b/src/readerfactory.c
@@ -144,6 +144,7 @@ LONG RFAllocateReaderSpace(unsigned int customMaxReaderHandles)
/* Zero out each value in the struct */
memset(readerStates[i].readerName, 0, MAX_READERNAME);
memset(readerStates[i].cardAtr, 0, MAX_ATR_SIZE);
+ readerStates[i].eventCounter = 0;
readerStates[i].readerState = 0;
readerStates[i].readerSharing = 0;
readerStates[i].cardAtrLength = READER_NOT_INITIALIZED;
--
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