summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 23aab622f1e..03a07c0af79 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.126 2013/10/10 12:29:35 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.127 2014/01/09 14:05:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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. */