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 'void
rfb::LogWriter::error(const char*, any, ...) [with any = int]':
../../common/rfb/LogWriter.h:92:5: warning: second parameter of
'va_start' not last named argument

I'm trying to find a way how to get rid of this warning but I haven't
been successful, yet.

Regards, Adam

On 02/11/2011 12:14 AM, Jochen Neubeck wrote:
> 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) {
>  vlog.error(e.str());
> }
>
> The %s from %silly% directs vlog.error() to substitute a non-existing
> char * argument, which might cause odd things including crash.
>
> Regards,
> Jochen
>


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to