From 4e4fbb67222400af79e3c1a3e7972c04747d8d82 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 20 Jun 2018 06:56:20 -0700 Subject: listener: fix crash in selection yanking. * linenoise/linenoise.c (yank_sel): Use wmalloc_fn because the size is being measured in characters rather than bytes. --- linenoise/linenoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 468c0a0b..a35aa32d 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1456,7 +1456,7 @@ static void yank_sel(lino_t *l) if (end - sel > 0) { lino_os.free_fn(l->clip); - l->clip = coerce(wchar_t *, lino_os.alloc_fn(end - sel + 1)); + l->clip = coerce(wchar_t *, lino_os.wmalloc_fn(end - sel + 1)); wmemcpy(l->clip, l->data + sel, end - sel); l->clip[end - sel] = 0; l->dpos = sel; -- cgit v1.2.3