From 1e19e4992bacd93b3ad49d2ede105234949b3408 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 4 Jun 2017 09:02:37 +0000 Subject: Be more strict about escape sequences that rename windows or set titles: ignore any that not valid UTF-8 outright, and for good measure pass the result through our UTF-8-aware vis(3). --- usr.bin/tmux/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin/tmux/window.c') diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 66b11660288..a890801a498 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.197 2017/05/31 10:15:51 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.198 2017/06/04 09:02:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -29,6 +29,7 @@ #include #include #include +#include #include "tmux.h" @@ -408,7 +409,7 @@ void window_set_name(struct window *w, const char *new_name) { free(w->name); - w->name = xstrdup(new_name); + utf8_stravis(&w->name, new_name, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL); notify_window("window-renamed", w); } -- cgit v1.2.3