Skip to content

Commit

Permalink
patch 9.1.0739: [security]: use-after-free in ex_getln.c
Browse files Browse the repository at this point in the history
Problem:  [security]: use-after-free in ex_getln.c
Solution: free pointer p a bit later (John Marriott)

closes: #15712

Signed-off-by: John Marriott <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
basilisk0315 authored and chrisbra committed Sep 21, 2024
1 parent a0c14ef commit a6de287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ex_getln.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,7 +3330,6 @@ realloc_cmdbuff(int len)
// there, thus copy up to the NUL and add a NUL.
mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen);
ccline.cmdbuff[ccline.cmdlen] = NUL;
vim_free(p);

if (ccline.xpc != NULL
&& ccline.xpc->xp_pattern != NULL
Expand All @@ -3345,6 +3344,8 @@ realloc_cmdbuff(int len)
ccline.xpc->xp_pattern = ccline.cmdbuff + i;
}

vim_free(p);

return OK;
}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
739,
/**/
738,
/**/
Expand Down

0 comments on commit a6de287

Please sign in to comment.