aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-07-13 20:01:08 +0100
committerThomas Adam <thomas@xteddy.org>2015-07-13 20:01:08 +0100
commitdcc28434f460f637976ca313e062c0728d438e97 (patch)
tree30fdfe86f2f46bd5425ac870d34d4e983f73be5c /client.c
parent07aef385910f46e09804756231ff1ef3e304e023 (diff)
parent8dcea2cc14448494d25a6a68618ae7088bef1b95 (diff)
downloadrtmux-dcc28434f460f637976ca313e062c0728d438e97.tar.gz
rtmux-dcc28434f460f637976ca313e062c0728d438e97.tar.bz2
rtmux-dcc28434f460f637976ca313e062c0728d438e97.zip
Merge branch 'obsd-master'
Diffstat (limited to 'client.c')
-rw-r--r--client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client.c b/client.c
index 9c493dfa..9a5ae455 100644
--- a/client.c
+++ b/client.c
@@ -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);