mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user