egl: move Null check to eglGetSyncAttribKHR to prevent Segfault
authorDongwon Kim <dongwon.kim@intel.com>
Tue, 2 Feb 2016 23:06:28 +0000 (15:06 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 19 Feb 2016 18:23:19 +0000 (18:23 +0000)
commitd1e1563bb63f08cdfec1b40b105bec7f343bc0b8
treeee8578a20cac60782ffd72788b6ebbd514ef0eb5
parentb697400a97d3137ff87560ebd2c41207b98cd61a
egl: move Null check to eglGetSyncAttribKHR to prevent Segfault

Null-check on "*value" is currently done in _eglGetSyncAttrib, which is
after eglGetSyncAttribKHR dereferences it.

Move the check a layer up (in the beginning of eglGetSyncAttribKHR) to
avoid segfaults.

Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
[Emil Velikov: tweak commit message, add stable tag]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/main/eglapi.c
src/egl/main/eglsync.c