To: vim_dev@googlegroups.com Subject: Patch 9.0.1076 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1076 Problem: ASAN complains about NULL argument. Solution: Skip memmove() when there is nothing to move. Files: src/vim9class.c *** ../vim-9.0.1075/src/vim9class.c 2022-12-18 21:42:49.010716927 +0000 --- src/vim9class.c 2022-12-19 12:16:16.520328897 +0000 *************** *** 164,170 **** *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); VIM_CLEAR(gap->ga_data); return OK; } --- 164,171 ---- *members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len); if (gap->ga_len > 0 && *members == NULL) return FAIL; ! if (gap->ga_len > 0) ! mch_memmove(*members, gap->ga_data, sizeof(ocmember_T) * gap->ga_len); VIM_CLEAR(gap->ga_data); return OK; } *** ../vim-9.0.1075/src/version.c 2022-12-18 22:01:38.873926637 +0000 --- src/version.c 2022-12-19 12:17:02.788283081 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1076, /**/ -- CUSTOMER: You're not fooling anyone y'know. Look, isn't there something you can do? DEAD PERSON: I feel happy... I feel happy. [whop] CUSTOMER: Ah, thanks very much. MORTICIAN: Not at all. See you on Thursday. CUSTOMER: Right. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///