From 3b9e778dacd3392fdf2e8fc29e726b401b50abfe Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Mon, 15 Feb 2021 18:53:06 -0500 Subject: Don't insert wchar_t if it can't be converted to mbs Otherwise it could hit the assertion in editBuffer while converting to mbs for consumption by the rest of the program. It's possibly to trigger this with LC_ALL=C and typing C-z C-v M-a, for example. --- edit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'edit.c') diff --git a/edit.c b/edit.c index fc23c58..3e7e1af 100644 --- a/edit.c +++ b/edit.c @@ -260,6 +260,8 @@ void edit(uint id, enum Edit op, wchar_t ch) { } break; case EditInsert: { + char mb[MB_LEN_MAX]; + if (wctomb(mb, ch) < 0) return; if (reserve(pos, 1)) { buf[pos++] = ch; } -- cgit 1.4.1-2-gfad0