diff options
author | Bram Moolenaar <bram@vim.org> | 2015-08-08 18:23:46 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2015-08-08 18:23:46 +0200 |
commit | a4ba1d418dcbe461fb112226d759e6b1f7d6b406 (patch) | |
tree | 77297b243cc49bb503a26c4bc6b5abf7947ffe6d /src | |
parent | cfae06862660b2a41236424c3c294b6ed15fed18 (diff) | |
download | vim-a4ba1d418dcbe461fb112226d759e6b1f7d6b406.tar.gz |
Problem: Gcc sanitizer complains about using a NULL pointer to memmove().
Solution: Only call memmove when there is something to move. (Vittorio
Zecca)
Diffstat (limited to 'src')
-rw-r--r-- | src/memline.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c index 8cd9b80b..a1c07a96 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 6546f6a0..7298a790 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, |