diff --git a/src/wayland-server.c b/src/wayland-server.c index eb1e5000..eab2ee45 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -353,7 +353,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data) } } - while ((size_t) len >= sizeof p) { + while (len >= 0 && (size_t) len >= sizeof p) { wl_connection_copy(connection, p, sizeof p); opcode = p[1] & 0xffff; size = p[1] >> 16;