From 4c47ce139e11613c5428cf86e88447ffdf6785b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 28 Dec 2017 17:03:50 +0100 Subject: [PATCH] qrexec: fix infinite loop when multiple services are waiting for GUI Reported by @ctrlaltdel Fixes QubesOS/qubes-issues#3433 --- qrexec/qrexec-agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qrexec/qrexec-agent.c b/qrexec/qrexec-agent.c index 2148f2a..15e43e2 100644 --- a/qrexec/qrexec-agent.c +++ b/qrexec/qrexec-agent.c @@ -624,8 +624,8 @@ void handle_server_exec_request_init(struct msg_header *hdr) if (hdr->type != MSG_SERVICE_CONNECT && wait_for_session_maybe(buf)) { /* waiting for session, postpone actual call */ - int slot_index = 0; - while (slot_index < MAX_FDS) + int slot_index; + for (slot_index = 0; slot_index < MAX_FDS; slot_index++) if (!requests_waiting_for_session[slot_index].cmdline) break; if (slot_index == MAX_FDS) {