<p dir="ltr"><br>
On Mar 28, 2013 2:29 PM, "Jonas Ådahl" <<a href="mailto:jadahl@gmail.com">jadahl@gmail.com</a>> wrote:<br>
><br>
> On Thu, Mar 28, 2013 at 7:48 PM, Rob Bradford <<a href="mailto:robert.bradford@intel.com">robert.bradford@intel.com</a>> wrote:<br>
> > From: Rob Bradford <<a href="mailto:rob@linux.intel.com">rob@linux.intel.com</a>><br>
> ><br>
> > If an unknown id is deleted then the lookup in the map will return NULL and<br>
> > so we should avoid dereferencing that.<br>
><br>
> Hi Rob,<br>
><br>
> I think the patch looks good, but I have one comment below.<br>
><br>
> Thanks,<br>
> Jonas<br>
><br>
> > ---<br>
> >  src/wayland-client.c | 2 +-<br>
> >  1 file changed, 1 insertion(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/src/wayland-client.c b/src/wayland-client.c<br>
> > index 0873835..e8d3240 100644<br>
> > --- a/src/wayland-client.c<br>
> > +++ b/src/wayland-client.c<br>
> > @@ -415,7 +415,7 @@ display_handle_delete_id(void *data, struct wl_display *display, uint32_t id)<br>
> >         pthread_mutex_lock(&display->mutex);<br>
> ><br>
> >         proxy = wl_map_lookup(&display->objects, id);<br>
> > -       if (proxy != WL_ZOMBIE_OBJECT)<br>
> > +       if (proxy && proxy != WL_ZOMBIE_OBJECT)<br>
> >                 proxy->flags |= WL_PROXY_FLAG_ID_DELETED;<br>
><br>
> I believe this could only ever happen if the compositor is<br>
> malfunctioning, as the delete_id event is only sent once for every id<br>
> being deleted. If we would get NULL here, it would mean that it would<br>
> already have been deleted by the server and destroyed by the client<br>
> without having been reused again.<br>
><br>
> Anyhow, I think it makes sense to avoid crashing when the server is<br>
> misbehaving, but would it maybe make sense to log a warning about it?</p>
<p dir="ltr">Along those lines there is another one on line 737 in queue_event that we may want to look at.  Again, this should only happen in the case of misbehaving compositors.<br>
--Jason Ekstrand.</p>
<p dir="ltr">><br>
> >         else<br>
> >                 wl_map_remove(&display->objects, id);<br>
> > --<br>
> > 1.8.1.2<br>
> ><br>
> > _______________________________________________<br>
> > wayland-devel mailing list<br>
> > <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</p>