From f5cbe4c9cab2873b60cd3c991732a250d2e164a2 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 23 Dec 2016 14:41:28 +0100 Subject: Remove all usage of vsnprintf (#8709) This change removes all usages of vsnprintf and modifies runtime to not to use vsnprintf or _vsnprintf I've also fixed two issues in PAL TRACE function string format parameters that caused crashes when I was trying to run all PAL tests with PAL tracing enabled. --- src/md/compiler/regmeta.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/md') diff --git a/src/md/compiler/regmeta.cpp b/src/md/compiler/regmeta.cpp index 230d1e4ff0..feb1cdd31b 100644 --- a/src/md/compiler/regmeta.cpp +++ b/src/md/compiler/regmeta.cpp @@ -829,7 +829,10 @@ int DumpMD_VWriteMarker(__in __in_z const char *str, va_list marker) { if (FAILED(hr = m_output.ReSizeNoThrow(STRING_BUFFER_LEN * i))) return 0; - count = _vsnprintf((char *)m_output.Ptr(), STRING_BUFFER_LEN * i, str, marker); + va_list markerCopy; + va_copy(markerCopy, marker); + count = _vsnprintf_s((char *)m_output.Ptr(), STRING_BUFFER_LEN * i, _TRUNCATE, str, markerCopy); + va_end(markerCopy); i *= 2; } OutputDebugStringA((LPCSTR)m_output.Ptr()); -- cgit v1.2.3