From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, mdroth@linux.vnet.ibm.com,
aliguori@amazon.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH 13/13] qapi: Add missing null check to opts_start_struct()
Date: Mon, 10 Feb 2014 08:28:29 -0700 [thread overview]
Message-ID: <52F8F01D.5000707@redhat.com> (raw)
In-Reply-To: <1392042045-31525-14-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]
On 02/10/2014 07:20 AM, Markus Armbruster wrote:
> Argument is null when visiting an unboxed struct. I can't see such a
> visit in the current code. Fix it anyway.
Is this a sign of missing testsuite coverage?
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> qapi/opts-visitor.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
> index 96ed858..5d830a2 100644
> --- a/qapi/opts-visitor.c
> +++ b/qapi/opts-visitor.c
> @@ -124,7 +124,9 @@ opts_start_struct(Visitor *v, void **obj, const char *kind,
> OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v);
> const QemuOpt *opt;
>
> - *obj = g_malloc0(size > 0 ? size : 1);
> + if (obj) {
> + *obj = g_malloc0(size > 0 ? size : 1);
> + }
> if (ov->depth++ > 0) {
> return;
> }
>
--
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 --]
next prev parent reply other threads:[~2014-02-10 15:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 14:20 [Qemu-devel] [PATCH v2 00/13] qapi: Test coverage & clean up generated code Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 01/13] tests/qapi-schema: Actually check successful QMP command response Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 02/13] tests/qapi-schema: Cover optional command arguments Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 03/13] tests/qapi-schema: Cover simple argument types Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 04/13] tests/qapi-schema: Cover anonymous union types Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 05/13] tests/qapi-schema: Cover complex types with base Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 06/13] tests/qapi-schema: Cover union " Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 07/13] tests/qapi-schema: Cover flat union types Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 08/13] qapi: Fix licensing of scripts Markus Armbruster
2014-02-10 15:26 ` Eric Blake
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 09/13] qapi: Drop nonsensical header guard in generated qapi-visit.c Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 10/13] qapi: Drop unused code in qapi-commands.py Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH v2 11/13] qapi: Clean up null checking in generated visitors Markus Armbruster
2014-02-10 14:20 ` [Qemu-devel] [PATCH 12/13] qapi: Clean up superfluous null check in qapi_dealloc_type_str() Markus Armbruster
2014-02-10 15:27 ` Eric Blake
2014-02-10 14:20 ` [Qemu-devel] [PATCH 13/13] qapi: Add missing null check to opts_start_struct() Markus Armbruster
2014-02-10 15:28 ` Eric Blake [this message]
2014-02-13 9:30 ` Paolo Bonzini
2014-02-13 9:31 ` [Qemu-devel] [PATCH v2 00/13] qapi: Test coverage & clean up generated code Paolo Bonzini
2014-02-13 13:41 ` Luiz Capitulino
2014-02-13 13:57 ` Luiz Capitulino
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=52F8F01D.5000707@redhat.com \
--to=eblake@redhat.com \
--cc=aliguori@amazon.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).