aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2015-01-18 23:57:35 +0200
committerAnthony G. Basile <blueness@gentoo.org>2015-01-25 16:36:53 -0500
commit0e18836796aaa697522a4dd5d8b89ac88aa9e87e (patch)
treede85fc4ab3de33356d4b29e9c7d70027de6bcb59
parentAssorted format fixes (diff)
downloadeudev-0e18836796aaa697522a4dd5d8b89ac88aa9e87e.tar.gz
eudev-0e18836796aaa697522a4dd5d8b89ac88aa9e87e.tar.bz2
eudev-0e18836796aaa697522a4dd5d8b89ac88aa9e87e.zip
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) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-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 f6270fd86..c2aa34110 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;
}