diff options
author | Tom Gundersen <teg@jklm.no> | 2014-09-17 21:44:56 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-09-17 20:24:12 -0400 |
commit | fb510149ad14851320b7b4d8c215caacca3bc2b1 (patch) | |
tree | e2ba123bcb05d524839c0140a54a916abe62929b /src | |
parent | 5d1b2ef5645394224545336f351212c0f8651fbf (diff) |
udev: event - explicitly don't read() from invalid fd
This fixes CID #1237641.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-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 b57eddf3cf..06a1378db9 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -495,6 +495,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]; |