From 98972e98f942fa3d3cd2b8f6a831da0a1f94551f Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Tue, 2 Apr 2013 19:32:59 +0200 Subject: Fixed segfault caused by FD_ISSET() on negative fd Reported by Kris Siwiec --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index cda0c4d..4962782 100644 --- a/main.c +++ b/main.c @@ -536,7 +536,7 @@ void run(void) xfd = MAX(xfd, info.fd); } select(xfd + 1, &fds, 0, 0, to_set ? &timeout : NULL); - if (FD_ISSET(info.fd, &fds)) + if (info.fd != -1 && FD_ISSET(info.fd, &fds)) read_info(); } -- cgit v1.2.3-54-g00ecf