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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri May 31 13:44:00 UTC 2013


Author: rousseau
Date: Fri May 31 13:44:00 2013
New Revision: 6643

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6643
Log:
get_ccid_device_descriptor(): check endpoint[] before access

Some non-CCID devices with bInterfaceClass = 0xFF may make the code
crash because they do not have endpoints.

This may happens using 'parse -p' to parse non CCID devices.

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=6643&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c (original)
+++ trunk/Drivers/ccid/src/ccid_usb.c Fri May 31 13:44:00 2013
@@ -837,7 +837,8 @@
 	 * descriptors; to support those, look for it at the end as well.
 	 */
 	last_endpoint = usb_interface->altsetting->bNumEndpoints-1;
-	if (usb_interface->altsetting->endpoint[last_endpoint].extra_length == 54)
+	if (usb_interface->altsetting->endpoint
+		&& usb_interface->altsetting->endpoint[last_endpoint].extra_length == 54)
 		return usb_interface->altsetting->endpoint[last_endpoint].extra;
 #else
 	DEBUG_CRITICAL2("Extra field has a wrong length: %d",




More information about the Pcsclite-cvs-commit mailing list