weston/desktop-shell
U. Artie Eoff cf5737aa41 shell: assert get_shell_surface() != NULL as appropriate
Various functions that operate on a weston_surface assume the
surface has a shell_surface.  That is, they unconditionally
deref the get_shell_surface() result.  Hence, if for some reason
the call to get_shell_surface() returned NULL to those functions then
a segmentation fault would occur and the program would crash.  So,
adding an assert(...) on the get_shell_surface() return value adds an
extra sanity check and does not change this behavior.  The assert also
adds an extra benefit to the programmer by documenting that the function
expects and requires the weston_surface to have a shell_surface and
would be a program logic error, otherwise.

The assert() also silences some static analyzers about the possible
NULL deref.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:06:05 -08:00
..
.gitignore Update .gitignore 2013-12-09 12:15:41 -08:00
exposay.c exposay: remove redundant NULL check in highlight_surface 2014-01-19 22:04:27 -08:00
input-panel.c input-panel: validate return value of get_default_view 2014-01-19 22:04:56 -08:00
Makefile.am build: Fix out-of-tree build for desktop-shell 2013-12-04 12:57:02 -08:00
shell.c shell: assert get_shell_surface() != NULL as appropriate 2014-01-19 22:06:05 -08:00
shell.h shell: Disable exposay by default 2014-01-16 16:52:12 -08:00