summaryrefslogtreecommitdiff
path: root/src/helpers/SdDaemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/SdDaemon.cpp')
-rw-r--r--src/helpers/SdDaemon.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/SdDaemon.cpp b/src/helpers/SdDaemon.cpp
index c3008807..b6c207d8 100644
--- a/src/helpers/SdDaemon.cpp
+++ b/src/helpers/SdDaemon.cpp
@@ -38,10 +38,10 @@ int NSystemd::sdNotify(int unsetEnvironment, const char* state) {
if (!addr)
return 0;
- // address length must be at most this; see man 7 unix
- size_t addrLen = strnlen(addr, 107);
-
struct sockaddr_un unixAddr = {0};
+
+ size_t addrLen = strnlen(addr, sizeof(unixAddr.sun_path) - 1);
+
unixAddr.sun_family = AF_UNIX;
strncpy(unixAddr.sun_path, addr, addrLen);
if (unixAddr.sun_path[0] == '@')