From 35df38c36a65bd0a9fd108f7e10ea6a593d5cdd7 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 11 Jul 2010 23:57:11 +0200 Subject: [PATCH] udevd: init_notify() fix abstract namespace name handling --- udev/udevd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/udev/udevd.c b/udev/udevd.c index e38c6016..873634fe 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -1006,7 +1006,9 @@ static int init_notify(const char *state) memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_name = &sockaddr; - msghdr.msg_namelen = sizeof(struct sockaddr_un); + msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e); + if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) + msghdr.msg_namelen = sizeof(struct sockaddr_un); msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; msghdr.msg_control = &control; -- 2.39.5