summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-06-14 15:35:58 +0000
committernicm <nicm@openbsd.org>2019-06-14 15:35:58 +0000
commit8b65c88bf637d1a890564e9e8522b895d0aef046 (patch)
treec69ad31db5bcdbfdfff642acc28e740fc110118b
parentNote a segv with fprintf if a file with long lines is loaded with (diff)
downloadwireguard-openbsd-8b65c88bf637d1a890564e9e8522b895d0aef046.tar.xz
wireguard-openbsd-8b65c88bf637d1a890564e9e8522b895d0aef046.zip
Do not loop forever if a menu item contains invisible characters,
reported by Thomas Sattler.
-rw-r--r--usr.bin/tmux/format-draw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/format-draw.c b/usr.bin/tmux/format-draw.c
index e1d3c8aaa1f..da361b41029 100644
--- a/usr.bin/tmux/format-draw.c
+++ b/usr.bin/tmux/format-draw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format-draw.c,v 1.9 2019/05/23 14:44:33 nicm Exp $ */
+/* $OpenBSD: format-draw.c,v 1.10 2019/06/14 15:35:58 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -791,7 +791,8 @@ format_width(const char *expanded)
} else if (*cp > 0x1f && *cp < 0x7f) {
width++;
cp++;
- }
+ } else
+ cp++;
}
return (width);
}