From 3c8f47bf2105374e9b0c3c0ea68cde6ceb0c06d1 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Fri, 3 Jan 2025 22:37:04 -0800 Subject: [PATCH] EmulatorPkg/Win/Host: Use safe function _vsnprintf_s() Update SecPrint() to use _vsnprintf_s() instead of _vsnprintf() that is a safe function and allows the defines _CRT_SECURE_NO_WARNINGS and _CRT_SECURE_NO_DEPRECATE to be removed from WinHost builds. Signed-off-by: Michael D Kinney --- EmulatorPkg/Win/Host/WinHost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c index ee834dd1a8..e69e9b6dbc 100644 --- a/EmulatorPkg/Win/Host/WinHost.c +++ b/EmulatorPkg/Win/Host/WinHost.c @@ -190,7 +190,7 @@ SecPrint ( va_start (Marker, Format); - _vsnprintf (Buffer, sizeof (Buffer), Format, Marker); + _vsnprintf_s (Buffer, sizeof (Buffer), sizeof (Buffer) - 1, Format, Marker); va_end (Marker);