[25896] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

svn rev #25386: branches/krb5-1-10/src/include/

daemon@ATHENA.MIT.EDU (tlyu@mit.edu)
Thu Oct 20 15:27:35 2011

Date: Thu, 20 Oct 2011 15:27:32 -0400
From: tlyu@mit.edu
Message-Id: <201110201927.p9KJRWZc011156@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=25386
Commit By: tlyu
Log Message:
ticket: 6980
version_fixed: 1.10
status: resolved

pull up r25367 from trunk

 ------------------------------------------------------------------------
 r25367 | ghudson | 2011-10-18 12:32:28 -0400 (Tue, 18 Oct 2011) | 12 lines

 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   branches/krb5-1-10/src/include/k5-platform.h
Modified: branches/krb5-1-10/src/include/k5-platform.h
===================================================================
--- branches/krb5-1-10/src/include/k5-platform.h	2011-10-20 15:16:03 UTC (rev 25385)
+++ branches/krb5-1-10/src/include/k5-platform.h	2011-10-20 19:27:32 UTC (rev 25386)
@@ -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

home help back first fref pref prev next nref lref last post