From 9c89c1cabd0357fa4e58a91c4d9233702896b709 Mon Sep 17 00:00:00 2001 From: Topi Miettinen Date: Sun, 18 Jan 2015 23:57:35 +0200 Subject: 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) --- src/libudev/libudev-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libudev') 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; } -- cgit v1.2.3-54-g00ecf