[Pcsclite-cvs-commit] r6501 - /trunk/PCSC/src/configfile.l

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jan 15 19:28:04 UTC 2013


Author: rousseau
Date: Tue Jan 15 19:28:04 2013
New Revision: 6501

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6501
Log:
Correctly calculate the FRIENDLYNAME field string size

If the FRIENDLYNAME field is NOT delimited by " then the string length
was wrong and a buffer overflow occured.

Thanks to Alan Kozlay for the bug report and patch

Modified:
    trunk/PCSC/src/configfile.l

Modified: trunk/PCSC/src/configfile.l
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/configfile.l?rev=6501&op=diff
==============================================================================
--- trunk/PCSC/src/configfile.l (original)
+++ trunk/PCSC/src/configfile.l Tue Jan 15 19:28:04 2013
@@ -91,7 +91,7 @@
 			{
 				size_t n, p;
 
-				pcFriendlyname = malloc(strlen(pcCurrent) - 1);
+				pcFriendlyname = malloc(strlen(pcCurrent) + 1);
 				for (n = 0, p = 0; n < strlen(pcCurrent); n++)
 				{
 					if (pcCurrent[n] != '"')




More information about the Pcsclite-cvs-commit mailing list