diff options
author | Tom Gundersen <teg@jklm.no> | 2014-09-17 21:44:56 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-09-17 22:19:53 +0200 |
commit | 3f796750b192e62701e91a95f85389f876d1059b (patch) | |
tree | f8ee60512e013ed342166e6413ed1209d0a0971d | |
parent | 4cd5d5adb6a573d8ffb336b82325e5f2bb188381 (diff) |
udev: event - explicitly don't read() from invalid fd
This fixes CID #1237641.
-rw-r--r-- | src/udev/udev-event.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 6b8b5a8efa..c8b142077e 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -494,6 +494,9 @@ static void spawn_read(struct udev_event *event, for (i = 0; i < fdcount; i++) { int *fd = (int *)ev[i].data.ptr; + if (*fd < 0) + continue; + if (ev[i].events & EPOLLIN) { ssize_t count; char buf[4096]; |