mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1076: ASAN complains about NULL argument
Problem: ASAN complains about NULL argument. Solution: Skip memmove() when there is nothing to move.
This commit is contained in:
parent
c336ae3ce6
commit
8efdcee02e
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1076,
|
||||||
/**/
|
/**/
|
||||||
1075,
|
1075,
|
||||||
/**/
|
/**/
|
||||||
|
@ -164,7 +164,8 @@ add_members_to_class(
|
|||||||
*members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len);
|
*members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len);
|
||||||
if (gap->ga_len > 0 && *members == NULL)
|
if (gap->ga_len > 0 && *members == NULL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
mch_memmove(*members, gap->ga_data, sizeof(ocmember_T) * gap->ga_len);
|
if (gap->ga_len > 0)
|
||||||
|
mch_memmove(*members, gap->ga_data, sizeof(ocmember_T) * gap->ga_len);
|
||||||
VIM_CLEAR(gap->ga_data);
|
VIM_CLEAR(gap->ga_data);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user