[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a cha
From: |
Corey Minyard |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 09/22/2014 12:20 PM, Peter Maydell wrote:
> On 22 September 2014 09:59, <address@hidden> wrote:
>> From: Corey Minyard <address@hidden>
>>
>> Signed-off-by: Corey Minyard <address@hidden>
>> Reviewed-by: Paolo Bonzini <address@hidden>
> 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
- [Qemu-devel] [PATCH v2 0/6] chardev: Add reconnecting to client sockets, minyard, 2014/09/22
- [Qemu-devel] [PATCH 2/6] qemu-char: Rework qemu_chr_open_socket() for reconnect, minyard, 2014/09/22
- [Qemu-devel] [PATCH 3/6] qemu-char: Move some items into TCPCharDriver, minyard, 2014/09/22
- [Qemu-devel] [PATCH 4/6] qemu-char: set socket filename to disconnected when not connected, minyard, 2014/09/22
- [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client sockets, minyard, 2014/09/22
- [Qemu-devel] [PATCH 6/6] qemu-char: Print the remote and local addresses for a socket, minyard, 2014/09/22
- [Qemu-devel] [PATCH 1/6] qemu-char: Make the filename size for a chardev a #define, minyard, 2014/09/22