Re: [PATCH] prevent free setting same cursor in worker in red_set_cursor

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

 



> 
> On Fri, Aug 21, 2015 at 10:26:40AM +0100, Frediano Ziglio wrote:
> > Currently caller don't call red_set_cursor with cursor in worker->cursor
> > but in theory is possible.
> > Doing so could cause the cursor to be freed and than reused as initially
> > the reference counter is 1 so object is freed but then attempted to
> > be used again.
> 
> I would say if the caller is doing that, then it should own a reference
> to the cursor and not rely on the reference owned by 'something else'
> (in this case RedWorker) to keep the object alive while it's being set.
> 
> Christophe
> 

IMHO better safe than sorry anyway. In other reference counter usage I saw this
problem. At the end the change costs nothing.

This patch is not going to fix anything beside the possibility of a
future change. In theory you are right, unless somebody just try to set same
cursor already set for some reason.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]