[25877] in CVS-changelog-for-Kerberos-V5
svn rev #25367: trunk/src/include/
daemon@ATHENA.MIT.EDU (ghudson@mit.edu)
Tue Oct 18 12:32:31 2011
Date: Tue, 18 Oct 2011 12:32:28 -0400
From: ghudson@mit.edu
Message-Id: <201110181632.p9IGWSq9007898@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
http://src.mit.edu/fisheye/changelog/krb5/?cs=25367
Commit By: ghudson
Log Message:
ticket: 6980
subject: Ensure termination in Windows vsnprintf wrapper
target_version: 1.10
tags: pullup
The Windows _vsnprintf does not terminate its output buffer in the
overflow case. Make sure we do that in the wrapper. Reported by
Chris Hecker.
(Not an issue for KfW 3.2 since we weren't using snprintf in 1.6.x
except in Unix-specific code.)
Changed Files:
U trunk/src/include/k5-platform.h
Modified: trunk/src/include/k5-platform.h
===================================================================
--- trunk/src/include/k5-platform.h 2011-10-17 22:55:44 UTC (rev 25366)
+++ trunk/src/include/k5-platform.h 2011-10-18 16:32:28 UTC (rev 25367)
@@ -958,8 +958,10 @@
va_copy(args_copy, args);
length = _vscprintf(format, args_copy);
va_end(args_copy);
- if (size)
+ if (size > 0) {
_vsnprintf(str, size, format, args);
+ str[size - 1] = '\0';
+ }
return length;
}
static inline int
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5