mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 18:27:22 +02:00
Fix another ancient bug in parsing of BRE-mode regular expressions.
While poking at the regex code, I happened to notice that the bug
squashed in commit afcc8772e
had a sibling: next() failed to return
a specific value associated with the '}' token for a "\{m,n\}"
quantifier when parsing in basic RE mode. Again, this could result
in treating the quantifier as non-greedy, which it never should be in
basic mode. For that to happen, the last character before "\}" that
sets "nextvalue" would have to set it to zero, or it'd have to have
accidentally been zero from the start. The failure can be provoked
repeatably with, for example, a bound ending in digit "0".
Like the previous patch, back-patch all the way.
This commit is contained in:
parent
5d319ce86f
commit
6e6fecf495
@ -389,7 +389,7 @@ next(struct vars *v)
|
|||||||
{
|
{
|
||||||
v->now++;
|
v->now++;
|
||||||
INTOCON(L_BRE);
|
INTOCON(L_BRE);
|
||||||
RET('}');
|
RETV('}', 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
FAILW(REG_BADBR);
|
FAILW(REG_BADBR);
|
||||||
|
Loading…
Reference in New Issue
Block a user