Skip to content

Commit

Permalink
patch 9.0.1076: ASAN complains about NULL argument
Browse files Browse the repository at this point in the history
Problem:    ASAN complains about NULL argument.
Solution:   Skip memmove() when there is nothing to move.
  • Loading branch information
brammool committed Dec 19, 2022
1 parent c336ae3 commit 8efdcee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1076,
/**/
1075,
/**/
Expand Down
3 changes: 2 additions & 1 deletion src/vim9class.c
Expand Up @@ -164,7 +164,8 @@ add_members_to_class(
*members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len);
if (gap->ga_len > 0 && *members == NULL)
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);
return OK;
}
Expand Down

0 comments on commit 8efdcee

Please sign in to comment.