From 29b998be68191b96543151e692dce9f790d0f552 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Tue, 8 Sep 2015 08:24:37 -0300 Subject: ui_bridge: Fix passing NULL pointer to memcpy --- src/nvim/ui_bridge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 2ec31de5e1..58345b5efa 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -233,8 +233,11 @@ static void ui_bridge_highlight_set_event(void **argv) static void ui_bridge_put(UI *b, uint8_t *text, size_t size) { - uint8_t *t = xmalloc(8); - memcpy(t, text, size); + uint8_t *t = NULL; + if (text) { + t = xmalloc(8); + memcpy(t, text, size); + } UI_CALL(b, put, 3, b, t, INT2PTR(size)); } static void ui_bridge_put_event(void **argv) -- cgit