diff options
author | Topi Miettinen <toiwoton@gmail.com> | 2015-01-18 23:57:35 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-01-25 16:36:53 -0500 |
commit | 0e18836796aaa697522a4dd5d8b89ac88aa9e87e (patch) | |
tree | de85fc4ab3de33356d4b29e9c7d70027de6bcb59 /src | |
parent | d98458c3c486f80dbf43287fb6b285d4e3806444 (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)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/libudev/libudev-monitor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index f6270fd860..c2aa341101 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; } |