From cd5c82a655f74b1395f6216d722d6366edb757f0 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Mar 2015 16:48:58 +0100 Subject: [PATCH] Fix unsafe format strings to the logging functions --- win/winvnc/ManagedListener.cxx | 2 +- win/winvnc/VNCServerWin32.cxx | 4 ++-- win/winvnc/winvnc.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win/winvnc/ManagedListener.cxx b/win/winvnc/ManagedListener.cxx index f2933bb0..e7728bc6 100644 --- a/win/winvnc/ManagedListener.cxx +++ b/win/winvnc/ManagedListener.cxx @@ -79,7 +79,7 @@ void ManagedListener::refresh() { if (port) sock = new network::TcpListener(NULL, port, localOnly); } catch (rdr::Exception& e) { - vlog.error(e.str()); + vlog.error("%s", e.str()); } if (sock) { if (!localOnly) diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index b1b9596e..36dbcee1 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -189,10 +189,10 @@ int VNCServerWin32::run() { vlog.debug("Server exited cleanly"); } catch (rdr::SystemException &s) { - vlog.error(s.str()); + vlog.error("%s", s.str()); result = s.err; } catch (rdr::Exception &e) { - vlog.error(e.str()); + vlog.error("%s", e.str()); } { Lock l(runLock); diff --git a/win/winvnc/winvnc.cxx b/win/winvnc/winvnc.cxx index 8fba9dcd..b9068657 100644 --- a/win/winvnc/winvnc.cxx +++ b/win/winvnc/winvnc.cxx @@ -87,7 +87,7 @@ static void MsgBoxOrLog(const char* msg, bool isError=false) { } else { if (isError) { try { - vlog.error(msg); + vlog.error("%s", msg); return; } catch (...) { } -- 2.39.5