forked from aniani/vim
patch 8.1.1720: crash with very long %[] pattern
Problem: Crash with very long %[] pattern. (Reza Mirzazade farkhani) Solution: Check for reg_toolong. (closes #4703)
This commit is contained in:
@@ -2175,7 +2175,11 @@ regatom(int *flagp)
|
||||
if (ret == NULL)
|
||||
ret = br;
|
||||
else
|
||||
{
|
||||
regtail(lastnode, br);
|
||||
if (reg_toolong)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ungetchr();
|
||||
one_exactly = TRUE;
|
||||
@@ -2200,6 +2204,8 @@ regatom(int *flagp)
|
||||
if (OP(br) == BRANCH)
|
||||
{
|
||||
regtail(br, lastbranch);
|
||||
if (reg_toolong)
|
||||
return NULL;
|
||||
br = OPERAND(br);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user