From edd3f51328df9c621277168c9dd77b1e80ccfd7c Mon Sep 17 00:00:00 2001 From: Robert Royals Date: Sun, 21 Jul 2024 22:54:27 +0100 Subject: Fix string length check Part-of: --- Xtranssock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Xtranssock.c') diff --git a/Xtranssock.c b/Xtranssock.c index 9482ecf..ebe45f1 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -748,7 +748,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract) if (*port == '/') /* a full pathname */ upath = ""; - if (strlen(port) + strlen(upath) > maxlen) + if (strlen(at) + strlen(upath) + strlen(port) > maxlen) return -1; snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port); return 0; -- cgit v1.2.3