Content-Length: 256385 | pFad | http://github.com/postgrespro/postgres_cluster/commit/bf9d3a5f847e91154b7cde255da7f24cd129ff35

B2 Fix another ancient bug in parsing of BRE-mode regular expressions. · postgrespro/postgres_cluster@bf9d3a5 · GitHub
Skip to content

Commit bf9d3a5

Browse files
committed
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.
1 parent d4b667e commit bf9d3a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/regex/regc_lex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ next(struct vars *v)
389389
{
390390
v->now++;
391391
INTOCON(L_BRE);
392-
RET('}');
392+
RETV('}', 1);
393393
}
394394
else
395395
FAILW(REG_BADBR);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/bf9d3a5f847e91154b7cde255da7f24cd129ff35

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy