summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2014-01-17 10:08:25 -0800
committerKristian Høgsberg <krh@bitplanet.net>2014-01-19 22:06:05 -0800
commitcf5737aa41fea485dec4eba26a51703887ae2a40 (patch)
treeed2a04e6b6fe092cc444059af42d9064aa49e02d /shared
parent0b23b2bd588da735200cfeef7a229f5adf3d60fc (diff)
downloadweston-cf5737aa41fea485dec4eba26a51703887ae2a40.tar.gz
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>
Diffstat (limited to 'shared')
0 files changed, 0 insertions, 0 deletions