pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
6+ messages / 1 participants
[nested] [flat]
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b5a66e7353ba65c11c5fc6a79b72213bde8dbe44
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
src/test/modules/test_regex/expected/test_regex.out | 9 ++++++++-
src/test/modules/test_regex/sql/test_regex.sql | 3 ++-
3 files changed, 11 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/bf9d3a5f847e91154b7cde255da7f24cd129ff35
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e7cddb5f29171a536233acecb7ac9b9c5e1b4c77
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6e6fecf495386e8aebfdc71ad6998eceb9da45e3
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/b0645097962575eee3546d7a65420f7c78725cec
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio
@ 2021-02-19 03:39 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-02-19 03:39 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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.
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/ab208421eeb785fc72a3e7fc1122127029165392
Modified Files
--------------
src/backend/regex/regc_lex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-02-19 03:39 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
2021-02-19 03:39 pgsql: Fix another ancient bug in parsing of BRE-mode regular expressio Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox