summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tmux.c b/tmux.c
index 74d827a5..c8f9e059 100644
--- a/tmux.c
+++ b/tmux.c
@@ -361,7 +361,11 @@ main(int argc, char **argv)
}
}
free(label);
- strlcpy(socket_path, path, sizeof socket_path);
+
+ if (strlcpy(socket_path, path, sizeof socket_path) >= sizeof socket_path) {
+ fprintf(stderr, "socket path too long: %s\n", path);
+ exit(1);
+ }
free(path);
/* Set process title. */