[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Sat, 04 Jun 2005 12:10:31 +0000


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv25497

Modified Files:
	hotplug_linux.c 
Log Message:
HPReadBundleValues(): exit early if too many readers are declared since the 
array to store them is static (PCSCLITE_MAX_READERS_CONTEXTS)


--- /cvsroot/pcsclite/PCSC/src/hotplug_linux.c	2005/05/26 14:50:13	1.35
+++ /cvsroot/pcsclite/PCSC/src/hotplug_linux.c	2005/06/04 12:10:31	1.36
@@ -8,7 +8,7 @@
  * The USB code was based partly on Johannes Erdfelt
  * libusb code found at libusb.sourceforge.net
  *
- * $Id: hotplug_linux.c,v 1.35 2005/05/26 14:50:13 rousseau Exp $
+ * $Id: hotplug_linux.c,v 1.36 2005/06/04 12:10:31 rousseau Exp $
  */
 
 /**
@@ -165,10 +165,17 @@
 
 				listCount++;
 				alias++;
+
+				if (listCount > sizeof(bundleTracker)/sizeof(bundleTracker[0]))
+				{
+					Log2(PCSC_LOG_CRITICAL, "Too many readers declared. Maximum is %d", sizeof(bundleTracker)/sizeof(bundleTracker[0]));
+					goto end;
+				}
 			}
 		}
 	}
 
+end:
 	bundleSize = listCount;
 
 	if (bundleSize == 0)