浏览代码

qrexec: fix infinite loop when multiple services are waiting for GUI

Reported by @ctrlaltdel
Fixes QubesOS/qubes-issues#3433
Marek Marczykowski-Górecki 6 年之前
父节点
当前提交
4c47ce139e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      qrexec/qrexec-agent.c

+ 2 - 2
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) {