[systemd-commits] src/libudev

David Herrmann dvdhrm at kemper.freedesktop.org
Sun Jan 18 14:31:30 PST 2015


 src/libudev/libudev-monitor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9c89c1cabd0357fa4e58a91c4d9233702896b709
Author: Topi Miettinen <toiwoton at gmail.com>
Date:   Sun Jan 18 23:57:35 2015 +0200

    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)

diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 484fefe..0d36142 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;
         }



More information about the systemd-commits mailing list