summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-01 21:49:19 +0100
committerSven Eden <yamakuzure@gmx.net>2017-04-26 12:58:55 +0200
commit5d0e1fed3db3c6fb6ce6d795e705694a86d2371f (patch)
treea765bac8f3e182879e9d28a2a7014d456d710677 /src
parent4060a1603b2e82e6086a13456139f306736571e8 (diff)
sd-daemon: verify NOTIFY_SOCKET path length
Diffstat (limited to 'src')
-rw-r--r--src/libelogind/sd-daemon/sd-daemon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libelogind/sd-daemon/sd-daemon.c b/src/libelogind/sd-daemon/sd-daemon.c
index e10444f49..172409b73 100644
--- a/src/libelogind/sd-daemon/sd-daemon.c
+++ b/src/libelogind/sd-daemon/sd-daemon.c
@@ -436,6 +436,11 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
goto finish;
}
+ if (strlen(e) > sizeof(sockaddr.un.sun_path)) {
+ r = -EINVAL;
+ goto finish;
+ }
+
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0);
if (fd < 0) {
r = -errno;