mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 00:37:59 +02:00
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>
This commit is contained in:
parent
cf7d95a688
commit
b2d79d504e
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue