From ed90ed62cdf1c4e7d59e4d279a5bf946b93057dd Mon Sep 17 00:00:00 2001
From: Kenny Levinsen <kl@kl.wtf>
Date: Mon, 21 Feb 2022 21:27:14 +0100
Subject: seatd-launch: Use snprintf for socket path

We also reduce the size of the buffer from 256 bytes to a much more
reasonable 32 bytes.
---
 seatd-launch/seatd-launch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/seatd-launch/seatd-launch.c b/seatd-launch/seatd-launch.c
index 4f15616..8057ba7 100644
--- a/seatd-launch/seatd-launch.c
+++ b/seatd-launch/seatd-launch.c
@@ -42,8 +42,8 @@ int main(int argc, char *argv[]) {
 	}
 	char **command = &argv[optind];
 
-	char sockpath[256];
-	sprintf(sockpath, "/tmp/seatd.%d.sock", getpid());
+	char sockpath[32];
+	snprintf(sockpath, sizeof sockpath, "/tmp/seatd.%d.sock", getpid());
 
 	int fds[2];
 	if (pipe(fds) == -1) {
-- 
cgit v1.2.3