From: Samuli Seppänen Date: Fri, 18 Feb 2011 09:39:27 +0000 (+0200) Subject: Temporary snprintf-related fix to service-win32/openvpnserv.c X-Git-Tag: v2.2-RC~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77d24405096452541700fb24aacd6f8a589fce3b;p=thirdparty%2Fopenvpn.git Temporary snprintf-related fix to service-win32/openvpnserv.c This is intended just as a TEMPORARY solution to get the 2.2-RC released. The intesion is to get this fixed with a better solution for the final 2.2 release. This patch has also been discussed here: http://thread.gmane.org/gmane.network.openvpn.devel/4325/ The only reason for this patch to be accepted in its current shape, is that it will be fixed before the final 2.2 release. Signed-off-by: Samuli Seppänen Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- diff --git a/service-win32/openvpnserv.c b/service-win32/openvpnserv.c index 07374e2e8..d0cfd9ba6 100755 --- a/service-win32/openvpnserv.c +++ b/service-win32/openvpnserv.c @@ -86,7 +86,7 @@ static HANDLE exit_event = NULL; /* snprintf with guaranteed null termination */ #define mysnprintf(out, ...) \ { \ - snprintf (out, sizeof(out), __VA_ARGS__); \ + _snprintf (out, sizeof(out), __VA_ARGS__); \ out [sizeof (out) - 1] = '\0'; \ } @@ -275,7 +275,6 @@ VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv) LONG status; DWORD len; DWORD type; - char error_string[256]; static const char error_format_str[] = "Error querying registry key of type REG_SZ: HKLM\\" REG_KEY "\\%s";