All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <andreas.faerber@web.de>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration
Date: Wed, 26 Feb 2014 16:56:15 -0700	[thread overview]
Message-ID: <530E7F1F.2040802@redhat.com> (raw)
In-Reply-To: <1393458706-24883-1-git-send-email-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

On 02/26/2014 04:51 PM, Peter Maydell wrote:
> The function qobject_from_json() doesn't actually allow its
> argument to be a format string -- it passes a NULL va_list*
> to qobject_from_jsonv(), and the parser code will then never
> actually intepret %-escape sequences (it tests whether the
> va_list pointer is NULL and will stop with a parse error).
> 
> The spurious attribute markup causes clang warnings in some
> of the test cases where we programmatically construct JSON
> to feed to qobject_from_json():
> 
>  tests/test-qmp-input-visitor.c:76:35: warning: format string is not a
>  string literal (potentially insecure) [-Wformat-security]
>     data->obj = qobject_from_json(json_string);
>                                   ^~~~~~~~~~~
> 
> Remove the incorrect attribute.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  include/qapi/qmp/qjson.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-02-26 23:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 23:51 [Qemu-devel] [PATCH] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration Peter Maydell
2014-02-26 23:56 ` Eric Blake [this message]
2014-03-02 13:21 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-03-02 22:51 ` [Qemu-devel] " Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530E7F1F.2040802@redhat.com \
    --to=eblake@redhat.com \
    --cc=andreas.faerber@web.de \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.