Krolyxon
Commit 98972e9

Branches

Refs →

nsxiv98972e9

Fixed segfault caused by FD_ISSET() on negative fd

Reported by Kris Siwiec
Author
Bert Münnich
Date
2013-04-02 19:32 +0200
Parent
af69b2a
Commit
98972e98f942fa3d3cd2b8f6a831da0a1f94551f

+2 −2

2 files changed

  1. M Makefile +1 −1
  2. M main.c +1 −1
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = 1.1
1+VERSION = git-20130402
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M main.c View
@@ -536,7 +536,7 @@ void run(void)
536536 xfd = MAX(xfd, info.fd);
537537 }
538538 select(xfd + 1, &fds, 0, 0, to_set ? &timeout : NULL);
539− if (FD_ISSET(info.fd, &fds))
539+ if (info.fd != -1 && FD_ISSET(info.fd, &fds))
540540 read_info();
541541 }
542542