Commit 94cb06a2 authored by Pekka Paalanen's avatar Pekka Paalanen
Browse files

ivi-shell: harden get_ivi_shell_surface()

Add more sanity checks to get_ivi_shell_surface() just in case.

If the configure hook is set, we must always have non-NULL

Check the ivi_shell_surface matches the surface.
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <>
Reviewed-by: default avatarEugen Friedrich <>
parent fd45f60f
......@@ -81,10 +81,16 @@ ivi_shell_surface_configure(struct weston_surface *, int32_t, int32_t);
static struct ivi_shell_surface *
get_ivi_shell_surface(struct weston_surface *surface)
if (surface->configure == ivi_shell_surface_configure)
return surface->configure_private;
struct ivi_shell_surface *shsurf;
if (surface->configure != ivi_shell_surface_configure)
return NULL;
shsurf = surface->configure_private;
assert(shsurf->surface == surface);
return NULL;
return shsurf;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment