summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authornicm <nicm>2014-01-09 14:05:55 +0000
committernicm <nicm>2014-01-09 14:05:55 +0000
commitadc1f21eaee899b8ecfdb6ef3676d9a25019e4fa (patch)
tree54d9a476292b7b41200ffa4cc5216c1b1e5aa28b /tmux.c
parent994cb872cfb5ef49a08a714d093d92bfee79b0e8 (diff)
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 '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. */