summaryrefslogtreecommitdiffstats
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-26 22:04:04 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-26 22:04:04 +0200
commit9ad89c6c4f89cd710d8244d8010b8b0ae30ba79d (patch)
tree47d4e016c05fa553fd36b0547029372a23475006 /src/misc1.c
parentce11de87e26e1420703242f8e07b4fd69c4032ba (diff)
patch 8.0.1223: crash when using autocomplete and tab pagesv8.0.1223
Problem: Crash when using autocomplete and tab pages. Solution: Check if the current tab changed. (Christian Brabandt, closes #2239)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/misc1.c b/src/misc1.c
index f7789ff794..eb893f6ee6 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2313,7 +2313,8 @@ ins_char_bytes(char_u *buf, int charlen)
/* Copy bytes after the changed character(s). */
p = newp + col;
- mch_memmove(p + newlen, oldp + col + oldlen,
+ if (linelen > col + oldlen)
+ mch_memmove(p + newlen, oldp + col + oldlen,
(size_t)(linelen - col - oldlen));
/* Insert or overwrite the new character. */