[Pcsclite-cvs-commit] r6384 - /trunk/PCSC/src/readerfactory.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Jul 1 19:00:07 UTC 2012


Author: rousseau
Date: Sun Jul  1 19:00:06 2012
New Revision: 6384

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6384
Log:
RFAddReader(): fix a off-by-one bug

strlen() returnd the number of characters without the final NUL byte.

The bugs was introduced in revision 6354.

Modified:
    trunk/PCSC/src/readerfactory.c

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=6384&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Sun Jul  1 19:00:06 2012
@@ -120,7 +120,7 @@
 		return SCARD_E_INVALID_VALUE;
 
 	/* allocate memory that is automatically freed */
-	readerName = alloca(strlen(readerNameLong));
+	readerName = alloca(strlen(readerNameLong)+1);
 	strcpy(readerName, readerNameLong);
 
 	/* Reader name too long? also count " 00 00"*/




More information about the Pcsclite-cvs-commit mailing list