1
0
forked from aniani/vim

patch 7.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)
This commit is contained in:
Bram Moolenaar 2015-08-08 18:23:46 +02:00
parent 204b93f958
commit fbd302ff38
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
812,
/**/
811,
/**/