[Pcsclite-cvs-commit] r6382 - /trunk/PCSC/src/spy/libpcscspy.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Jul 1 16:01:49 UTC 2012


Author: rousseau
Date: Sun Jul  1 16:01:49 2012
New Revision: 6382

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6382
Log:
spy_line(): move the call to va_end(args); earlier

In case the buffer is too small we exit the function without calling
va_end().

Coverity: Missing varargs init or cleanup (VARARGS)

Modified:
    trunk/PCSC/src/spy/libpcscspy.c

Modified: trunk/PCSC/src/spy/libpcscspy.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/spy/libpcscspy.c?rev=6382&op=diff
==============================================================================
--- trunk/PCSC/src/spy/libpcscspy.c (original)
+++ trunk/PCSC/src/spy/libpcscspy.c Sun Jul  1 16:01:49 2012
@@ -189,6 +189,7 @@
 
 	va_start(args, fmt);
 	size = vsnprintf(line, sizeof line, fmt, args);
+	va_end(args);
 	if ((size_t)size >= sizeof line)
 	{
 		printf("libpcsc-spy: Buffer is too small!\n");
@@ -200,7 +201,6 @@
 	write(Log_fd, line, size);
 	write(Log_fd, "\n", 1);
 	pthread_mutex_unlock(&Log_fd_mutex);
-	va_end(args);
 }
 
 static void spy_enter(const char *fname)




More information about the Pcsclite-cvs-commit mailing list