From f00586ee5f47b7c7fa8d92f01f61d1ba593c142d Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Mon, 29 Jul 2024 15:27:10 -0400 Subject: [PATCH] connection: Add comments explaining safety No functional change intended. Signed-off-by: Demi Marie Obenour --- src/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connection.c b/src/connection.c index 330e45c2..300c28d8 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1052,7 +1052,10 @@ wl_connection_demarshal(struct wl_connection *connection, goto err; } + /* This ring buffer will always have a multiple of sizeof(int) + * bytes in it. */ ring_buffer_copy(&connection->fds_in, &fd, sizeof fd); + /* This can wrap but that is okay. */ connection->fds_in.tail += sizeof fd; closure->args[i].h = fd; break;