[Pcsclite-cvs-commit] r6326 - /trunk/Drivers/ccid/src/ccid_usb.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Jun 6 12:06:38 UTC 2012


Author: rousseau
Date: Wed Jun  6 12:06:37 2012
New Revision: 6326

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6326
Log:
OpenUSBByName(): check the lists vendorID, productID and friendlyNames
have all the same size.

This should prevent a crash if the parsing failed. For example it would
avoid a crash due to a bug similar to the one fixed in revision 6325: ie
a reader with [ ] in its name.

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

Modified: trunk/Drivers/ccid/src/ccid_usb.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid_usb.c?rev=6326&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c (original)
+++ trunk/Drivers/ccid/src/ccid_usb.c Wed Jun  6 12:06:37 2012
@@ -278,6 +278,15 @@
 	GET_KEYS("ifdVendorID", &ifdVendorID)
 	GET_KEYS("ifdProductID", &ifdProductID);
 	GET_KEYS("ifdFriendlyName", &ifdFriendlyName)
+
+	/* The 3 lists do not have the same size */
+	if  ((list_size(ifdVendorID) != list_size(ifdProductID))
+		|| (list_size(ifdVendorID) != list_size(ifdFriendlyName)))
+	{
+		DEBUG_CRITICAL2("Error parsing %s", infofile);
+		return_value = STATUS_UNSUCCESSFUL;
+		goto end1;
+	}
 
 	/* for any supported reader */
 	for (alias=0; alias<list_size(ifdVendorID); alias++)




More information about the Pcsclite-cvs-commit mailing list