Re: udscs: The read buffer is always reset to NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 28, 2016 at 09:40:56AM +0100, Francois Gouget wrote:
> Tweak the code to clarify that conn->data.buf is set to NULL after the
> free() in udscs_read_complete().
> Note that this reset is needed to avoid a double-free in
> udscs_destroy_connection() if an error occurs while receiving
> the next message header.
> 
> Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
> ---
> 
> On Fri, 25 Nov 2016, Christophe Fergeau wrote:
> >
> > This memset should 'buf' to NULL. (can't remember if I took that into
> > account while writing the patch though :)
> 
> Maybe tweaking the code like below could help make this clearer. The 
> comment may be overkill, or maybe on the contrary it should be made more 
> explicit.

Does not hurt to make this explicit indeed,

Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]