0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00

patch 9.1.1751: potential buffer-overflow in find_pattern_in_path()

Problem:  potential buffer-overflow in find_pattern_in_path()
Problem:  Verify ptr p has enough room before adding ins_compl_len()

fixes: #18195
closes: #18249

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-09-10 04:09:23 -04:00
parent 2525c56e42
commit 21ecb0d2e2
2 changed files with 3 additions and 1 deletions

View File

@@ -3795,7 +3795,7 @@ search_line:
break;
found = TRUE;
aux = p = startp;
if (compl_status_adding())
if (compl_status_adding() && (int)STRLEN(p) >= ins_compl_len())
{
p += ins_compl_len();
if (vim_iswordp(p))

View File

@@ -724,6 +724,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1751,
/**/
1750,
/**/