changeset 31487:df58407c97f3 v9.0.1076

patch 9.0.1076: ASAN complains about NULL argument Commit: https://github.com/vim/vim/commit/8efdcee02ed02cf9e51e1757441715c2479757ee Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 19 12:18:09 2022 +0000 patch 9.0.1076: ASAN complains about NULL argument Problem: ASAN complains about NULL argument. Solution: Skip memmove() when there is nothing to move.
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Dec 2022 13:30:08 +0100
parents 96ff54827295
children c81f178ad433
files src/version.c src/vim9class.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1076,
+/**/
     1075,
 /**/
     1074,
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -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;
 }