[systemd-devel] [PATCH] libudev: fix check for too long packet
David Herrmann
dh.herrmann at gmail.com
Sun Jan 18 14:31:05 PST 2015
Hi
On Sun, Jan 18, 2015 at 10:57 PM, Topi Miettinen <toiwoton at gmail.com> wrote:
> Don't use recvmsg(2) return value to check for too long packets
> (it doesn't work) but MSG_TRUNC flag.
> ---
> src/libudev/libudev-monitor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied!
Thanks
David
> diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
> index 484fefe..d8e551b 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;
> }
> --
> 2.1.4
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list