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>
dev
Daniel Stone 3 years ago
parent cdfe94b105
commit f48cf18a16
  1. 2
      compositor/main.c

@ -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)) {

Loading…
Cancel
Save