[Pcsclite-cvs-commit] r5833 - /trunk/Drivers/ccid/src/ccid_serial.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Jul 6 09:09:52 UTC 2011


Author: rousseau
Date: Wed Jul  6 09:09:52 2011
New Revision: 5833

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5833
Log:
OpenSerialByName(): use safer strlcpy() instead of strncpy()

coverity: Event buffer_size_warning: Calling strncpy with a maximum size
argument of 255 bytes on destination array "reader_name" of size 255
bytes might leave the destination string unterminated.

Modified:
    trunk/Drivers/ccid/src/ccid_serial.c

Modified: trunk/Drivers/ccid/src/ccid_serial.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid_serial.c?rev=5833&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid_serial.c (original)
+++ trunk/Drivers/ccid/src/ccid_serial.c Wed Jul  6 09:09:52 2011
@@ -659,7 +659,7 @@
 	if (p)
 	{
 		/* copy the second part of the string */
-		strncpy(reader_name, p+1, sizeof(reader_name));
+		strlcpy(reader_name, p+1, sizeof(reader_name));
 
 		/* replace ':' by '\0' so that dev_name only contains the device name */
 		*p = '\0';




More information about the Pcsclite-cvs-commit mailing list