Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2011-05-10 Thread Jochen Neubeck
might creep back into the code base as awareness of the issue fades. Regards, Jochen - Original Message - From: "Adam Tkac" To: "Jochen Neubeck" Cc: Sent: Tuesday, May 03, 2011 1:29 PM Subject: Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter

Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2011-05-03 Thread Adam Tkac
I mobilized all my programming skills but I wasn't able to get rid of warnings written below so I must reject this change. In long term the only way seems to use C++ I/O operators in LogWriter class which can safely deal with your example code. I checked source code and it seems there aren't wron

Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2011-04-29 Thread Adam Tkac
Sorry for late response, this mail got lost in my queue. You are right that current LogWriter implementation will have problems with your example. However your patch causes following compilation warnings: In file included from CConnection.cxx:28:0: ../../common/rfb/LogWriter.h: In member function

Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2011-02-10 Thread Jochen Neubeck
Consider the following example: try { static const char silly_example[] = "just a %silly% example"; char expanded[100]; if (!ExpandEnvironmentStrings(silly_example, expanded, sizeof expanded)) throw rdr::Exception("failed to expand %s", silly_example); } catch (rdr::exception &e) { vlo

Re: [Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2011-02-07 Thread Adam Tkac
On Sat, Dec 04, 2010 at 10:12:25AM +0100, Jochen Neubeck wrote: > LogWriter output methods are at times called with just a single > argument, which LogWriter always treats as an sprintf format string, > but which is not always meant to be such. I have seen this in a few > catch blocks which involve

[Tigervnc-devel] [PATCH] Help avoid improper use of LogWriter output methods

2010-12-04 Thread Jochen Neubeck
LogWriter output methods are at times called with just a single argument, which LogWriter always treats as an sprintf format string, but which is not always meant to be such. I have seen this in a few catch blocks which involve logging of the preformatted diagnostic messages provided by the exc