Package: libtickit / 0.2-5

0002-Don-t-attempt-to-select-on-invalid-fds-thanks-Steve-.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
Date: Mon, 9 Apr 2018 23:47:47 +0100
Subject: Don't attempt to select() on invalid fds (thanks Steve Langasek)
 (LP#1744933)

---
 src/term.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/term.c b/src/term.c
index d65fb6d..6ec3f44 100644
--- a/src/term.c
+++ b/src/term.c
@@ -682,6 +682,9 @@ void tickit_term_input_wait_msec(TickitTerm *tt, long msec)
   FD_ZERO(&readfds);
 
   int fd = termkey_get_fd(tk);
+  if (fd < 0 || fd >= FD_SETSIZE)
+    return;
+
   FD_SET(fd, &readfds);
   int ret = select(fd + 1, &readfds, NULL, NULL, msec > -1 ? &timeout : NULL);