[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/4] Update modified mac address in place in virGetInterface

On Wed, Jul 22, 2009 at 11:25:38AM -0400, Laine Stump wrote:
> On 07/22/2009 10:20 AM, Daniel Veillard wrote:
> >Agreed, patch applied, I only had to add _() to get the message localized,
> I've idly wondered about that macro, as it causes scores of compile 
> warnings, like this:
> datatypes.c:291: warning: format not a string literal and no format 
> arguments
> What's it for? And what's the best way to change things to eliminate the 
> warnings?

It is a potential security hole, if the user finds a way to send a string
with an embeded format specifier. Thus if you're not doing any subsitutions,
and the string isn't constant, then you should always at least do

  char *therealstring = ...from somewhere untrusted...
  printf("%s", therealstring)

NB, anyone sending patches should always set


when running 'autogen.sh' and make sure all warnings & errors are fixed 
before submitting a patch.

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]