Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 47992273ce508412cfe8a882efea6fc2 > files > 2

ccid-1.4.0-2.fc14.src.rpm

Index: src/ccid_serial.c
===================================================================
--- src/ccid_serial.c	(revision 5380)
+++ src/ccid_serial.c	(revision 5382)
@@ -310,6 +310,12 @@
 	/* total frame size */
 	to_read = 10+dw2i(buffer, 1);
 
+	if ((to_read < 10) || (to_read > (int)*length))
+	{
+		DEBUG_CRITICAL2("Wrong value for frame size: %d", to_read);
+		return STATUS_COMM_ERROR;
+	}
+
 	DEBUG_COMM2("frame size: %d", to_read);
 	if ((rv = get_bytes(reader_index, buffer+5, to_read-5)) != STATUS_SUCCESS)
 		return rv;