[Pcsclite-cvs-commit] r2097 - trunk/Drivers/ccid/src

Ludovic Rousseau rousseau at costa.debian.org
Tue Jul 4 07:06:12 UTC 2006


Author: rousseau
Date: 2006-07-04 07:06:10 +0000 (Tue, 04 Jul 2006)
New Revision: 2097

Modified:
   trunk/Drivers/ccid/src/ccid_usb.c
Log:
ReadUSB(): be sure we have read enough bytes before checking for frame
detectation


Modified: trunk/Drivers/ccid/src/ccid_usb.c
===================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c	2006-07-03 14:56:08 UTC (rev 2096)
+++ trunk/Drivers/ccid/src/ccid_usb.c	2006-07-04 07:06:10 UTC (rev 2097)
@@ -516,7 +516,8 @@
 	DEBUG_XXD(debug_header, buffer, *length);
 
 #define BSEQ_OFFSET 6
-	if (buffer[BSEQ_OFFSET] < *ccid_descriptor->pbSeq -1)
+	if ((*length >= BSEQ_OFFSET)
+		&& (buffer[BSEQ_OFFSET] < *ccid_descriptor->pbSeq -1))
 	{
 		DEBUG_INFO("Duplicate frame detected");
 		goto read_again;




More information about the Pcsclite-cvs-commit mailing list