summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-monitor.c
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2015-01-18 23:57:35 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-01-18 23:31:11 +0100
commit9c89c1cabd0357fa4e58a91c4d9233702896b709 (patch)
treedf60ace3fae98182f83090d7d0e608fe04131331 /src/libudev/libudev-monitor.c
parent0193ad26ba121f3df259cc8b3bab54a99b8e5252 (diff)
libudev: fix check for too long packet
Don't use recvmsg(2) return value to check for too long packets (it doesn't work) but MSG_TRUNC flag. (David: add parantheses around condition)
Diffstat (limited to 'src/libudev/libudev-monitor.c')
-rw-r--r--src/libudev/libudev-monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 484fefeebf..0d361426f7 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -609,7 +609,7 @@ retry:
return NULL;
}
- if (buflen < 32 || (size_t)buflen >= sizeof(buf)) {
+ if (buflen < 32 || (smsg.msg_flags & MSG_TRUNC)) {
log_debug("invalid message length");
return NULL;
}