Fixed segfault caused by FD_ISSET() on negative fd
Reported by Kris Siwiec
This commit is contained in:
parent
af69b2a7bb
commit
98972e98f9
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
VERSION = 1.1
|
VERSION = git-20130402
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
|
2
main.c
2
main.c
@ -536,7 +536,7 @@ void run(void)
|
|||||||
xfd = MAX(xfd, info.fd);
|
xfd = MAX(xfd, info.fd);
|
||||||
}
|
}
|
||||||
select(xfd + 1, &fds, 0, 0, to_set ? &timeout : NULL);
|
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();
|
read_info();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user