]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Temporary snprintf-related fix to service-win32/openvpnserv.c
authorSamuli Seppänen <samuli@openvpn.net>
Fri, 18 Feb 2011 09:39:27 +0000 (11:39 +0200)
committerDavid Sommerseth <davids@redhat.com>
Mon, 28 Feb 2011 10:25:26 +0000 (11:25 +0100)
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 <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
service-win32/openvpnserv.c

index 07374e2e87033004f217a90868188a5301bd4f8e..d0cfd9ba6d57278081eba24c1e0f3bdbc703ef49 100755 (executable)
@@ -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";