=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/client.c,v retrieving revision 1.90 retrieving revision 1.91 diff -c -r1.90 -r1.91 *** src/usr.bin/tmux/client.c 2015/06/14 10:07:44 1.90 --- src/usr.bin/tmux/client.c 2015/07/13 18:10:26 1.91 *************** *** 1,4 **** ! /* $OpenBSD: client.c,v 1.90 2015/06/14 10:07:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: client.c,v 1.91 2015/07/13 18:10:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 350,355 **** --- 350,356 ---- { const char *s; char **ss; + size_t sslen; int fd; pid_t pid; *************** *** 374,381 **** 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); client_write_one(MSG_IDENTIFY_DONE, -1, NULL, 0); --- 375,385 ---- pid = getpid(); client_write_one(MSG_IDENTIFY_CLIENTPID, -1, &pid, sizeof pid); ! 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);