Patch 9.0.1042

3 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 9, 2022, 5:50:14 PM12/9/22
to vim...@googlegroups.com

Patch 9.0.1042
Problem: ASAN gives false alarm about array access.
Solution: Use an intermediate pointer.
Files: src/vim9class.c


*** ../vim-9.0.1041/src/vim9class.c 2022-12-09 21:41:43.908327271 +0000
--- src/vim9class.c 2022-12-09 22:39:30.166805632 +0000
***************
*** 441,447 ****
for (int i = 0; i < cl->class_obj_method_count; ++i)
{
ufunc_T *fp = cl->class_obj_methods[i];
! if (STRNCMP(name, fp->uf_name, len) == 0 && fp->uf_name[len] == NUL)
{
typval_T argvars[MAX_FUNC_ARGS + 1];
int argcount = 0;
--- 441,450 ----
for (int i = 0; i < cl->class_obj_method_count; ++i)
{
ufunc_T *fp = cl->class_obj_methods[i];
! // Use a separate pointer to avoid that ASAN complains about
! // uf_name[] only being 4 characters.
! char_u *ufname = (char_u *)fp->uf_name;
! if (STRNCMP(name, ufname, len) == 0 && ufname[len] == NUL)
{
typval_T argvars[MAX_FUNC_ARGS + 1];
int argcount = 0;
*** ../vim-9.0.1041/src/version.c 2022-12-09 21:41:43.908327271 +0000
--- src/version.c 2022-12-09 22:48:59.207494656 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1042,
/**/

--
A cow comes flying over the battlements, lowing aggressively. The cow
lands on GALAHAD'S PAGE, squashing him completely.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages