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.)
ticket: 6980
target_version: 1.10
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25367
dc483132-0cff-0310-8789-
dd5450dbe970
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