From 4e637b1b610f93d474a60daa4ab78afef66b29bc Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 13 Jul 2015 18:10:26 +0000 Subject: [PATCH 1/2] Ignore environment variables that are too long to send to the server. --- client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index 4b7bbb1f..63432926 100644 --- a/client.c +++ b/client.c @@ -350,6 +350,7 @@ client_send_identify(int flags) { const char *s; char **ss; + size_t sslen; int fd; pid_t pid; @@ -374,8 +375,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); From 8dcea2cc14448494d25a6a68618ae7088bef1b95 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 13 Jul 2015 18:45:18 +0000 Subject: [PATCH 2/2] Reset G0/G1 state when resetting everything else with send-keys -R. --- input.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/input.c b/input.c index d1ff17fe..095816c3 100644 --- a/input.c +++ b/input.c @@ -801,10 +801,7 @@ input_reset(struct window_pane *wp) { struct input_ctx *ictx = wp->ictx; - memcpy(&ictx->cell, &grid_default_cell, sizeof ictx->cell); - memcpy(&ictx->old_cell, &ictx->cell, sizeof ictx->old_cell); - ictx->old_cx = 0; - ictx->old_cy = 0; + input_reset_cell(ictx); if (wp->mode == NULL) screen_write_start(&ictx->ctx, wp, &wp->base);