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

Ludovic Rousseau rousseau at costa.debian.org
Mon Jul 3 13:16:00 UTC 2006


Author: rousseau
Date: 2006-07-03 13:15:59 +0000 (Mon, 03 Jul 2006)
New Revision: 2086

Modified:
   trunk/Drivers/ccid/src/commands.c
Log:
CCID_Receive(): use <= instead of < to detect a reception buffer overrun
and log an error if it occurs


Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c	2006-07-03 12:57:50 UTC (rev 2085)
+++ trunk/Drivers/ccid/src/commands.c	2006-07-03 13:15:59 UTC (rev 2086)
@@ -865,10 +865,13 @@
 	}
 
 	length = dw2i(cmd, 1);
-	if (length < *rx_length)
+	if (length <= *rx_length)
 		*rx_length = length;
 	else
+	{
+		DEBUG_CRITICAL2("overrun by %d bytes", length - *rx_length);
 		length = *rx_length;
+	}
 	memcpy(rx_buffer, cmd+10, length);
 
 	return IFD_SUCCESS;




More information about the Pcsclite-cvs-commit mailing list