Avoid infinite recursion on:
echo "foo foo bar bar bar baz" | sed 's/\([^ ]*\)\( *\1\)*/\1/g' Obtained from: OpenBSD via NetBSD (rev. 1.18)
This commit is contained in:
parent
7df8cf04c7
commit
01efaf95b8
@ -674,6 +674,8 @@ sopno lev; /* PLUS nesting level */
|
||||
return(NULL);
|
||||
assert(m->pmatch[i].rm_so != -1);
|
||||
len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so;
|
||||
if (len == 0)
|
||||
return(NULL);
|
||||
assert(stop - m->beginp >= len);
|
||||
if (sp > stop - len)
|
||||
return(NULL); /* not enough left to match */
|
||||
|
Loading…
x
Reference in New Issue
Block a user