aboutsummaryrefslogtreecommitdiff
path: root/libseat
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-09-22 00:53:01 +0200
committerKenny Levinsen <kl@kl.wtf>2020-09-22 01:14:24 +0200
commit0132841987f4a847e91d3592162340af425f3c55 (patch)
treeb7a9f4c262060d5d0c60ffb0c56602c3d03338ae /libseat
parent884c1416b302e9d855453d8e83cc09e54796a434 (diff)
libseat/seatd: Fix socket path bounds
Diffstat (limited to 'libseat')
-rw-r--r--libseat/backend/seatd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c
index 1259308..f728a33 100644
--- a/libseat/backend/seatd.c
+++ b/libseat/backend/seatd.c
@@ -72,7 +72,7 @@ static int seatd_connect(void) {
path = SEATD_DEFAULTPATH;
}
addr.unix.sun_family = AF_UNIX;
- strncpy(addr.unix.sun_path, path, sizeof addr.unix.sun_path);
+ strncpy(addr.unix.sun_path, path, sizeof addr.unix.sun_path - 1);
socklen_t size = offsetof(struct sockaddr_un, sun_path) + strlen(addr.unix.sun_path);
if (connect(fd, &addr.generic, size) == -1) {
log_debugf("Could not connect to socket: %s", strerror(errno));