0
0
mirror of https://github.com/vim/vim.git synced 2025-10-23 08:44:20 -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; break;
found = TRUE; found = TRUE;
aux = p = startp; aux = p = startp;
if (compl_status_adding()) if (compl_status_adding() && (int)STRLEN(p) >= ins_compl_len())
{ {
p += ins_compl_len(); p += ins_compl_len();
if (vim_iswordp(p)) if (vim_iswordp(p))

View File

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