Fix unsafe usage of the logging functions.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4905 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx
index 43252f1..52dc6bd 100644
--- a/win/rfb_win32/CleanDesktop.cxx
+++ b/win/rfb_win32/CleanDesktop.cxx
@@ -178,7 +178,7 @@
       if (ad.enable(false))
         restoreActiveDesktop = true;
     } catch (rdr::Exception& e) {
-      vlog.error(e.str());
+      vlog.error("%s", e.str());
     }
 
     // -=- Switch of normal wallpaper and notify apps
@@ -186,7 +186,7 @@
     restoreWallpaper = true;
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
 
@@ -203,7 +203,7 @@
         ad.enable(true);
         restoreActiveDesktop = false;
       } catch (rdr::Exception& e) {
-        vlog.error(e.str());
+        vlog.error("%s", e.str());
       }
     }
 
@@ -216,7 +216,7 @@
     }
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
 
@@ -230,7 +230,7 @@
     restorePattern = true;
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
 
@@ -252,7 +252,7 @@
     }
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
 
@@ -288,7 +288,7 @@
     restoreEffects = true;
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
 
@@ -317,6 +317,6 @@
     }
 
   } catch (rdr::Exception& e) {
-    vlog.info(e.str());
+    vlog.info("%s", e.str());
   }
 }
diff --git a/win/rfb_win32/Clipboard.cxx b/win/rfb_win32/Clipboard.cxx
index a4c43f0..482519e 100644
--- a/win/rfb_win32/Clipboard.cxx
+++ b/win/rfb_win32/Clipboard.cxx
@@ -185,7 +185,7 @@
 
     vlog.debug("set clipboard");
   } catch (rdr::Exception& e) {
-    vlog.debug(e.str());
+    vlog.debug("%s", e.str());
   }
 
   // - Close the clipboard
diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx
index 921e1fa..cc9bbca 100644
--- a/win/rfb_win32/DeviceFrameBuffer.cxx
+++ b/win/rfb_win32/DeviceFrameBuffer.cxx
@@ -276,7 +276,7 @@
     server->setCursor(cursor.width(), cursor.height(), cursor.hotspot,
                       cursorBm.data, cursor.mask.buf);
   } catch (rdr::Exception& e) {
-    vlog.error(e.str());
+    vlog.error("%s", e.str());
   }
 }
 
diff --git a/win/rfb_win32/MonitorInfo.cxx b/win/rfb_win32/MonitorInfo.cxx
index 0a5e34f..c57cd26 100644
--- a/win/rfb_win32/MonitorInfo.cxx
+++ b/win/rfb_win32/MonitorInfo.cxx
@@ -80,7 +80,7 @@
       return;
     }
   } catch (rdr::Exception& e) {
-    vlog.error(e.str());
+    vlog.error("%s", e.str());
   }
 #endif
 
@@ -106,7 +106,7 @@
       return;
     }
   } catch (rdr::Exception& e) {
-    vlog.error(e.str());
+    vlog.error("%s", e.str());
   }
 #endif
 
diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx
index 90980c3..30cb310 100644
--- a/win/rfb_win32/RegConfig.cxx
+++ b/win/rfb_win32/RegConfig.cxx
@@ -48,7 +48,7 @@
     processEvent(event);
     return true;
   } catch (rdr::Exception& e) {
-    vlog.debug(e.str());
+    vlog.debug("%s", e.str());
     return false;
   }
 }
@@ -65,7 +65,7 @@
     }
   } catch (rdr::SystemException& e) {
     if (e.err != 6)
-      vlog.error(e.str());
+      vlog.error("%s", e.str());
   }
 }
 
diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx
index 583b4ab..6d0c924 100644
--- a/win/rfb_win32/SDisplay.cxx
+++ b/win/rfb_win32/SDisplay.cxx
@@ -185,7 +185,7 @@
       if (tryMethod == 0)
         throw rdr::Exception("unable to access desktop");
       tryMethod--;
-      vlog.error(e.str());
+      vlog.error("%s", e.str());
     }
   }
   vlog.info("Started %s", core->methodName());
@@ -388,7 +388,7 @@
       try {
         core->flushUpdates();
       } catch (rdr::Exception& e) {
-        vlog.error(e.str());
+        vlog.error("%s", e.str());
         restartCore();
         return;
       }
diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx
index 9a0dab4..d4f1965 100644
--- a/win/rfb_win32/SocketManager.cxx
+++ b/win/rfb_win32/SocketManager.cxx
@@ -43,7 +43,7 @@
   if (WSAIoctl(sock_->getFd(), SIO_ADDRESS_LIST_CHANGE, 0, 0, 0, 0, &dummy, 0, 0) == SOCKET_ERROR) {
     DWORD err = WSAGetLastError();
     if (err != WSAEWOULDBLOCK)
-      vlog.error("Unable to track address changes", err);
+      vlog.error("Unable to track address changes: 0x%08x", (unsigned)err);
   }
 }
 
@@ -70,7 +70,7 @@
     if (event)
       WSACloseEvent(event);
     delete sock_;
-    vlog.error(e.str());
+    vlog.error("%s", e.str());
     throw;
   }
 
@@ -204,7 +204,7 @@
       if (WSAEventSelect(ci.sock->getFd(), event, FD_READ | FD_CLOSE) == SOCKET_ERROR)
         throw rdr::SystemException("unable to re-enable WSAEventSelect:%u", WSAGetLastError());
     } catch (rdr::Exception& e) {
-      vlog.error(e.str());
+      vlog.error("%s", e.str());
       remSocket(ci.sock);
     }
   }