diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-07-14 08:15:05 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-07-14 08:15:05 +0100 |
commit | 5ffb869e1a543b264b9d94a19077d16f9832aff5 (patch) | |
tree | 59392329b2b678d46667e0960efa9e2c7dfb202a /client.c | |
parent | bed3069fd746741286e624126774f98ed51fbbdf (diff) | |
parent | dcc28434f460f637976ca313e062c0728d438e97 (diff) | |
download | rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.tar.gz rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.tar.bz2 rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -354,6 +354,7 @@ client_send_identify(int flags) { const char *s; char **ss; + size_t sslen; int fd; pid_t pid; @@ -378,8 +379,11 @@ client_send_identify(int flags) pid = getpid(); client_write_one(MSG_IDENTIFY_CLIENTPID, -1, &pid, sizeof pid); - for (ss = environ; *ss != NULL; ss++) - client_write_one(MSG_IDENTIFY_ENVIRON, -1, *ss, strlen(*ss) + 1); + for (ss = environ; *ss != NULL; ss++) { + sslen = strlen(*ss) + 1; + if (sslen <= MAX_IMSGSIZE - IMSG_HEADER_SIZE) + client_write_one(MSG_IDENTIFY_ENVIRON, -1, *ss, sslen); + } client_write_one(MSG_IDENTIFY_DONE, -1, NULL, 0); |