summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-17 21:44:56 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-09-17 20:24:12 -0400
commitfb510149ad14851320b7b4d8c215caacca3bc2b1 (patch)
treee2ba123bcb05d524839c0140a54a916abe62929b /src
parent5d1b2ef5645394224545336f351212c0f8651fbf (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.c3
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];