diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-09-08 08:24:37 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-09-18 14:35:26 -0300 |
commit | 29b998be68191b96543151e692dce9f790d0f552 (patch) | |
tree | 6523c0472c4bd43010cd9750bd30da0239c565b0 | |
parent | a4c41735359d0114e678cbf4888c514f604f01dd (diff) | |
download | rneovim-29b998be68191b96543151e692dce9f790d0f552.tar.gz rneovim-29b998be68191b96543151e692dce9f790d0f552.tar.bz2 rneovim-29b998be68191b96543151e692dce9f790d0f552.zip |
ui_bridge: Fix passing NULL pointer to memcpy
-rw-r--r-- | src/nvim/ui_bridge.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |