]> granicus.if.org Git - vim/commitdiff
patch 7.4.812 v7.4.812
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Aug 2015 16:23:46 +0000 (18:23 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Aug 2015 16:23:46 +0000 (18:23 +0200)
Problem:    Gcc sanitizer complains about using a NULL pointer to memmove().
Solution:   Only call memmove when there is something to move. (Vittorio
            Zecca)

src/memline.c
src/version.c

index 8cd9b80b2ad21b1f8ac96a175dc200da7c107aec..a1c07a967bbfdd734118af8e1973d0b4a9621bfb 100644 (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;
index 6546f6a01661883fd3ff811bc6a72b2d794fa627..7298a79095927f6abcb5d80b8999819c45cb1d2c 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    812,
 /**/
     811,
 /**/