mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
server: fail on global name overflow
display->id is initialized to 1, making 0 a convenient value to indicate an invalid global name. Make sure to not return a zero global name on overflow. Moreover, if we wrap around, we might cycle back to a global name which is already in-use. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
9700155eda
commit
be31c5a8c8
1 changed files with 5 additions and 0 deletions
|
|
@ -1285,6 +1285,11 @@ wl_global_create(struct wl_display *display,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (display->id >= UINT32_MAX) {
|
||||
wl_log("wl_global_create: ran out of global names\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
global = zalloc(sizeof *global);
|
||||
if (global == NULL)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue