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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Feb 4 12:42:02 UTC 2011


Author: rousseau
Date: Fri Feb  4 12:41:58 2011
New Revision: 5578

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5578
Log:
CmdXfrBlockCHAR_T0(): use 'int' instead of 'char' for backup_len
variable since it can contain up to 256.

Thanks to el Tuba for the patch.

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=5578&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Fri Feb  4 12:41:58 2011
@@ -1843,7 +1843,6 @@
 	unsigned char tmp_buf[512];
 	unsigned int exp_len, in_len;
 	unsigned char ins, *in_buf;
-	unsigned char backup_len = *rcv_len;
 	RESPONSECODE return_value = IFD_SUCCESS;
 	_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
 
@@ -1852,12 +1851,15 @@
 	if (PROTOCOL_ICCD_A == ccid_descriptor->bInterfaceProtocol)
 	{
 		unsigned char pcbuffer[SIZE_GET_SLOT_STATUS];
+		unsigned int backup_len;
 
 		/* length is on 16-bits only
 		 * if a size > 0x1000 is used then usb_control_msg() fails with
 		 * "Invalid argument" */
 		if (*rcv_len > 0x1000)
 			*rcv_len = 0x1000;
+
+		backup_len = *rcv_len;
 
 		/* Command to send to the smart card (must be 5 bytes) */
 		memset(cmd, 0, sizeof(cmd));




More information about the Pcsclite-cvs-commit mailing list