mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
wayland-client: Handle potential NULL-deref
Instead, return -1 on out-of-memory. errno will be set to ENOMEM by the failing malloc.
This commit is contained in:
parent
8bd93c5c9d
commit
e0579bfb61
1 changed files with 2 additions and 0 deletions
|
|
@ -662,6 +662,8 @@ wl_display_roundtrip(struct wl_display *display)
|
||||||
|
|
||||||
done = 0;
|
done = 0;
|
||||||
callback = wl_display_sync(display);
|
callback = wl_display_sync(display);
|
||||||
|
if (callback == NULL)
|
||||||
|
return -1;
|
||||||
wl_callback_add_listener(callback, &sync_listener, &done);
|
wl_callback_add_listener(callback, &sync_listener, &done);
|
||||||
while (!done && ret >= 0)
|
while (!done && ret >= 0)
|
||||||
ret = wl_display_dispatch(display);
|
ret = wl_display_dispatch(display);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue