[Spice-devel] [PATCH 18/24] server/red_channel: protect red_channel_push from NULL

Alon Levy alevy at redhat.com
Wed Feb 2 13:15:38 PST 2011


On Wed, Feb 02, 2011 at 07:52:59PM +0100, Marc-André Lureau wrote:
> Context? Isn't that critical?
> 

we dereference it right after, so I remember this was basically a fix
for a segfault. But unfortunately I don't remember the callstack. I
could turn this into an assert, I'm sure someone will complain ;)

> On Wed, Jan 19, 2011 at 7:08 PM, Alon Levy <alevy at redhat.com> wrote:
> > ---
> >  server/red_channel.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/server/red_channel.c b/server/red_channel.c
> > index 3dada93..bfa6aaf 100644
> > --- a/server/red_channel.c
> > +++ b/server/red_channel.c
> > @@ -481,6 +481,10 @@ void red_channel_push(RedChannel *channel)
> >  {
> >     PipeItem *pipe_item;
> >
> > +    if (!channel) {
> > +        return;
> > +    }
> > +
> >     if (!channel->during_send) {
> >         channel->during_send = TRUE;
> >     } else {
> > --
> > 1.7.3.4
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
> 
> 
> 
> -- 
> Marc-André Lureau


More information about the Spice-devel mailing list