From: Kevin Wolf <kwolf@redhat.com>
To: jim@meyering.net
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Anthony Liguori" <aliguori@us.ibm.com>,
"Stefan Hajnoczi" <stefanha@linux.vnet.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jim Meyering" <meyering@redhat.com>,
qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Avi Kivity" <avi@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
"Floris Bos" <dev@noc-ps.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 2/3] scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL
Date: Tue, 15 May 2012 15:35:56 +0200 [thread overview]
Message-ID: <4FB25BBC.3070901@redhat.com> (raw)
In-Reply-To: <1337087078-24056-3-git-send-email-jim@meyering.net>
Am 15.05.2012 15:04, schrieb jim@meyering.net:
> From: Jim Meyering <meyering@redhat.com>
>
> Use g_strdup rather than strdup, because the sole caller
> (qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
> it. Besides, in that caller, the allocated buffer is already freed with
> g_free, so it's better to allocate with a matching g_strdup.
>
> In one case, (scsi-bus.c) it was trivial, so I replaced an snprintf+
> g_strdup combination with an equivalent g_strdup_printf use.
>
> Signed-off-by: Jim Meyering <meyering@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
next prev parent reply other threads:[~2012-05-15 13:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 13:04 [Qemu-devel] [PATCH 0/3] unchecked uses of strdup jim
2012-05-15 13:04 ` [Qemu-devel] [PATCH 1/3] envlist.c: handle strdup failure jim
2012-05-19 15:55 ` Blue Swirl
2012-05-21 10:25 ` Jim Meyering
2012-05-21 17:56 ` Blue Swirl
2012-05-22 8:23 ` Kevin Wolf
2012-05-22 9:05 ` Jim Meyering
2012-05-22 9:34 ` Kevin Wolf
2012-05-22 9:50 ` Jim Meyering
2012-05-15 13:04 ` [Qemu-devel] [PATCH 2/3] scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL jim
2012-05-15 13:13 ` Paolo Bonzini
2012-05-15 13:35 ` Kevin Wolf [this message]
2012-05-15 13:04 ` [Qemu-devel] [PATCH 3/3] sparc: use g_strdup in place of unchecked strdup jim
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=4FB25BBC.3070901@redhat.com \
--to=kwolf@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=avi@redhat.com \
--cc=dev@noc-ps.com \
--cc=hpoussin@reactos.org \
--cc=jim@meyering.net \
--cc=meyering@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@linux.vnet.ibm.com \
/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).