qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 8/9] Add more format string warning flags


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 8/9] Add more format string warning flags
Date: Mon, 2 Apr 2012 15:32:51 +0100

On 2 April 2012 15:22, Daniel P. Berrange <address@hidden> wrote:
> The -Wformat-security option can only catch problems if the format
> string is a literal. eg so it'd miss this:
>
>  void foo(void) {
>     int notastring = 1;
>     const char *format = "String is %s";
>
>     sprintf(format, notastring);
>  }
>
> There are a handful of places in QEMU which do that with non-trivial
> format strings & were easy to fix in this patch, which I think is a
> worthwhile improvement. The cases in the *-user/strace.c file though
> are not practical to fix, without significant re-design of the code
> in question.

To be honest I couldn't tell from your patch whether you'd actually
fixed any bugs or if you were just moving things around to turn non
literals into literals.

(Some of the cleanup looks like a good idea anyway, eg the vnc bits.)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]