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

Ludovic Rousseau rousseau at alioth.debian.org
Thu May 3 19:21:54 UTC 2007


Author: rousseau
Date: 2007-05-03 19:21:54 +0000 (Thu, 03 May 2007)
New Revision: 2510

Modified:
   trunk/Drivers/ccid/src/ccid_usb.c
Log:
get_end_points(): avoid a double free on close for the O2MICRO_OZ776
special case.

" In ccid_usb.c you move the extra descriptor from the endpoint 2
descriptor to the interface descriptor. The problem is, when libusb try
to free the descriptors associated to this device on shutdown or if the
device disappears, it tries to free the same buffer twice. For me it
means the pcscd is killed with a glibc detected "double free". "

Thanks to Michael Wegner for the patch


Modified: trunk/Drivers/ccid/src/ccid_usb.c
===================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c	2007-05-03 15:21:29 UTC (rev 2509)
+++ trunk/Drivers/ccid/src/ccid_usb.c	2007-05-03 19:21:54 UTC (rev 2510)
@@ -664,6 +664,9 @@
 				usb_interface->altsetting->extralen = 54;
 				usb_interface->altsetting->extra =
 					usb_interface->altsetting->endpoint[i].extra;
+				/* avoid double free on close */
+				usb_interface->altsetting->endpoint[i].extra = NULL;
+				usb_interface->altsetting->endpoint[i].extralen = 0;
 				break;
 			}
 		}




More information about the Pcsclite-cvs-commit mailing list