summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-08-08 18:23:46 +0200
committerBram Moolenaar <Bram@vim.org>2015-08-08 18:23:46 +0200
commitfbd302ff38624abdec64980f4a19379d20a6e6c6 (patch)
treef034dcc6fde785a494f884184f816e80357fe576
parent204b93f95831454e6924acf30b16fd4bdfda0d14 (diff)
patch 7.4.812v7.4.812
Problem: Gcc sanitizer complains about using a NULL pointer to memmove(). Solution: Only call memmove when there is something to move. (Vittorio Zecca)
-rw-r--r--src/memline.c3
-rw-r--r--src/version.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c
index 8cd9b80b2a..a1c07a967b 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -3834,7 +3834,8 @@ ml_add_stack(buf)
(buf->b_ml.ml_stack_size + STACK_INCR));
if (newstack == NULL)
return -1;
- mch_memmove(newstack, buf->b_ml.ml_stack,
+ if (top > 0)
+ mch_memmove(newstack, buf->b_ml.ml_stack,
(size_t)top * sizeof(infoptr_T));
vim_free(buf->b_ml.ml_stack);
buf->b_ml.ml_stack = newstack;
diff --git a/src/version.c b/src/version.c
index 6546f6a016..7298a79095 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 812,
+/**/
811,
/**/
810,