summaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2015-07-09 21:30:16 -0700
committerBryce Harrington <bryce@osg.samsung.com>2015-07-10 18:08:26 -0700
commitb2d79d504efaab06088a011bf25c9affe1dbc3d1 (patch)
tree7f7ec9ff26fb0614a3659f3d3534c5f98613c981 /xwayland
parentcf7d95a6880c820630a6810895be6acaf9ab1e6c (diff)
downloadweston-b2d79d504efaab06088a011bf25c9affe1dbc3d1.tar.gz
xwayland: Check return of xcb_get_property_reply() before deref
The man pages indicate this routine can return NULL on certain error conditions. Suggested by Marek Chalupa Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 451b9153..2f60c0ec 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -111,6 +111,8 @@ weston_wm_get_incr_chunk(struct weston_wm *wm)
0x1fffffff /* length */);
reply = xcb_get_property_reply(wm->conn, cookie, NULL);
+ if (reply == NULL)
+ return;
dump_property(wm, wm->atom.wl_selection, reply);
@@ -184,6 +186,8 @@ weston_wm_get_selection_targets(struct weston_wm *wm)
4096 /* length */);
reply = xcb_get_property_reply(wm->conn, cookie, NULL);
+ if (reply == NULL)
+ return;
dump_property(wm, wm->atom.wl_selection, reply);
@@ -236,6 +240,8 @@ weston_wm_get_selection_data(struct weston_wm *wm)
0x1fffffff /* length */);
reply = xcb_get_property_reply(wm->conn, cookie, NULL);
+ if (reply == NULL)
+ return;
if (reply->type == wm->atom.incr) {
dump_property(wm, wm->atom.wl_selection, reply);