compositor: Fix harmless potential buffer overflow

We could overflow a local buffer if there were more than ten million
concurrently active displays within the current user's session. This
seems vanishingly unlikely, and harmless, but does at least squash a
compiler warning emitted by gcc 12+.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-03-29 15:35:58 +01:00
parent cdfe94b105
commit f48cf18a16

View file

@ -829,7 +829,7 @@ handle_primary_client_destroyed(struct wl_listener *listener, void *data)
static int
weston_create_listening_socket(struct wl_display *display, const char *socket_name)
{
char name_candidate[16];
char name_candidate[32];
if (socket_name) {
if (wl_display_add_socket(display, socket_name)) {