From: Bram Moolenaar Date: Sat, 8 Aug 2015 16:23:46 +0000 (+0200) Subject: patch 7.4.812 X-Git-Tag: v7.4.812 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbd302ff38624abdec64980f4a19379d20a6e6c6;p=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) --- diff --git a/src/memline.c b/src/memline.c index 8cd9b80b2..a1c07a967 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 6546f6a01..7298a7909 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 812, /**/ 811, /**/