aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-09-08 08:24:37 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-09-18 14:35:26 -0300
commit29b998be68191b96543151e692dce9f790d0f552 (patch)
tree6523c0472c4bd43010cd9750bd30da0239c565b0
parenta4c41735359d0114e678cbf4888c514f604f01dd (diff)
downloadrneovim-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.c7
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)