summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-01-09 14:05:55 +0000
committernicm <nicm@openbsd.org>2014-01-09 14:05:55 +0000
commit6f63102103f8ef3238260ac53efb7f86edd0c6ac (patch)
tree1bc853cde99867df3606c55eecbe927a1e8a6c1d /usr.bin/tmux/tmux.c
parentStyle and comment fixes from Tiago Cunha. (diff)
downloadwireguard-openbsd-6f63102103f8ef3238260ac53efb7f86edd0c6ac.tar.xz
wireguard-openbsd-6f63102103f8ef3238260ac53efb7f86edd0c6ac.zip
Three small changes from Tiago Cunha:
- Check for truncation when copying path. - Don't need to use a temporary buffer in screen_set_title. - Include strerror in output when connecting to server fails.
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. */