]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix a mistaken use of a format string in logevent().
authorSimon Tatham <anakin@pobox.com>
Fri, 27 Nov 2015 23:55:16 +0000 (23:55 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 29 Feb 2016 19:59:34 +0000 (19:59 +0000)
logevent() doesn't do printf-style formatting (though the logeventf
wrapper in ssh.c does), so if you need to format a message, it has to
be done separately with dupprintf.

(cherry picked from commit 1659cf3f1455f7e3d9c97a66f90a0cfa914d1ce3)

windows/window.c

index bcb0d9ca95ac4c23ffd006ef9c04a311f3070d2d..03325054bf79983bd3bcc463bb5d41b2b334679d 100644 (file)
@@ -398,8 +398,10 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
 #ifndef UNPROTECT
         char *error = NULL;
         if (! setprocessacl(error)) {
-           logevent(NULL, "Could not restrict process ACL: %s",
-                    error);
+            char *message = dupprintf("Could not restrict process ACL: %s",
+                                      error);
+           logevent(NULL, message);
+            sfree(message);
            sfree(error);
        }
 #endif