mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
sd-daemon: verify NOTIFY_SOCKET path length
Better generate a real error then simply connect to the wrong socket.
This commit is contained in:
parent
a47806fafa
commit
638b56cd3c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user