[Pcsclite-cvs-commit] r2762 - /trunk/Drivers/ccid/src/commands.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Jan 24 09:21:13 UTC 2008


Author: rousseau
Date: Thu Jan 24 09:21:13 2008
New Revision: 2762

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2762
Log:
CCID_Receive(): return an error if we have read less (or more) data than
the CCID frame says to contain

Modified:
    trunk/Drivers/ccid/src/commands.c

Modified: trunk/Drivers/ccid/src/commands.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?rev=2762&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Thu Jan 24 09:21:13 2008
@@ -1247,6 +1247,14 @@
 		goto time_request;
 	}
 
+	/* we have read less (or more) data than the CCID frame says to contain */
+	if (length-10 != dw2i(cmd, 1))
+	{
+		DEBUG_CRITICAL3("Can't read all data (%d out of %d expected)",
+			length-10, dw2i(cmd, 1));
+		return_value = IFD_COMMUNICATION_ERROR;
+	}
+
 	length = dw2i(cmd, 1);
 	if (length <= *rx_length)
 		*rx_length = length;




More information about the Pcsclite-cvs-commit mailing list