From: Corey Minyard <cminyard@mvista.com>
To: Peter Maydell <peter.maydell@linaro.org>, minyard@acm.org
Cc: mjg59@srcf.ucam.org, "Michael S. Tsirkin" <mst@redhat.com>,
hwd@huawei.com, "QEMU Developers" <qemu-devel@nongnu.org>,
bcketchum@gmail.com, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define
Date: Mon, 22 Sep 2014 15:02:06 -0500 [thread overview]
Message-ID: <5420803E.5090804@mvista.com> (raw)
In-Reply-To: <CAFEAcA9spsXT_nJz4pY=g7dr-Ta6Jr=hCdvjRN7pznvruJuzMg@mail.gmail.com>
On 09/22/2014 12:20 PM, Peter Maydell wrote:
> On 22 September 2014 09:59, <minyard@acm.org> wrote:
>> From: Corey Minyard <cminyard@mvista.com>
>>
>> Signed-off-by: Corey Minyard <cminyard@mvista.com>
>> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Wouldn't it be better to just drop the max-size restriction
> by using g_strdup_printf (and then free when done) rather than
> snprintf into a fixed size buffer?
>
> thanks
> -- PMM
I'm not sure. I was trying to minimize changes, but I did this because
the malloc and snprintf were being moved apart from each other.
This is also being used in some arrays declared on the stack, which
also might need fixing.
There may be race conditions with the filename if you free it and replace
it, but I'm not really sure. Someone who knows better than me would
have to speak to that.
-corey
next prev parent reply other threads:[~2014-09-22 20:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 16:59 [Qemu-devel] [PATCH v2 0/6] chardev: Add reconnecting to client sockets minyard
2014-09-22 16:59 ` [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define minyard
2014-09-22 17:20 ` Peter Maydell
2014-09-22 20:02 ` Corey Minyard [this message]
2014-09-22 16:59 ` [Qemu-devel] [PATCH 2/6] qemu-char: Rework qemu_chr_open_socket() for reconnect minyard
2014-09-22 16:59 ` [Qemu-devel] [PATCH 3/6] qemu-char: Move some items into TCPCharDriver minyard
2014-09-22 16:59 ` [Qemu-devel] [PATCH 4/6] qemu-char: set socket filename to disconnected when not connected minyard
2014-09-22 16:59 ` [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client sockets minyard
2014-09-22 20:26 ` Eric Blake
2014-09-22 16:59 ` [Qemu-devel] [PATCH 6/6] qemu-char: Print the remote and local addresses for a socket minyard
-- strict thread matches above, loose matches on Subject: below --
2014-10-02 16:17 [Qemu-devel] [PATCH v5 0/6] Add reconnecting to client sockets minyard
2014-10-02 16:17 ` [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define minyard
2014-10-01 21:09 [Qemu-devel] [PATCH v4 0/6] Add reconnect capability to sockets minyard
2014-10-01 21:09 ` [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define minyard
2014-09-25 20:07 [Qemu-devel] [PATCH v3 0/6] chardev: Add reconnecting to client sockets minyard
2014-09-25 20:07 ` [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define minyard
2014-09-21 23:04 [Qemu-devel] [PATCH 0/6] Add reconnect capability for client sockets minyard
2014-09-21 23:04 ` [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define minyard
2014-09-22 7:46 ` Paolo Bonzini
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=5420803E.5090804@mvista.com \
--to=cminyard@mvista.com \
--cc=afaerber@suse.de \
--cc=bcketchum@gmail.com \
--cc=hwd@huawei.com \
--cc=minyard@acm.org \
--cc=mjg59@srcf.ucam.org \
--cc=mst@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 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.