summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rw-r--r--udev/udevd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/udev/udevd.c b/udev/udevd.c
index e38c601649..873634fe45 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;