qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]