mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 16:11:48 +02:00
9bbf6f7341
The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a defined referent. To fix, think a little more rigorously about what the contract between different levels of cdissect's recursion needs to be. With the right spec, we can fix this using fewer rather than more resets of the match data; the key decision being that a failed sub-match is now explicitly responsible for clearing any matches it may have set. There are enough other cross-checks and optimizations in the code that it's not especially easy to exhibit this problem; usually, the match will fail as-expected. Plus, regexps that are even potentially vulnerable are most likely user errors, since there's just not much point in writing a back-ref that doesn't always have a referent. These facts perhaps explain why the issue hasn't been detected, even though it's almost certainly a couple of decades old. Discussion: https://postgr.es/m/151435.1629733387@sss.pgh.pa.us |
||
---|---|---|
.. | ||
brin | ||
commit_ts | ||
delay_execution | ||
dummy_index_am | ||
dummy_seclabel | ||
libpq_pipeline | ||
plsample | ||
snapshot_too_old | ||
spgist_name_ops | ||
ssl_passphrase_callback | ||
test_bloomfilter | ||
test_ddl_deparse | ||
test_extensions | ||
test_ginpostinglist | ||
test_integerset | ||
test_misc | ||
test_parser | ||
test_pg_dump | ||
test_predtest | ||
test_rbtree | ||
test_regex | ||
test_rls_hooks | ||
test_shm_mq | ||
unsafe_tests | ||
worker_spi | ||
Makefile | ||
README |
Test extensions and libraries ============================= src/test/modules contains PostgreSQL extensions that are primarily or entirely intended for testing PostgreSQL and/or to serve as example code. The extensions here aren't intended to be installed in a production server and aren't suitable for "real work". Furthermore, while you can do "make install" and "make installcheck" in this directory or its children, it is NOT ADVISABLE to do so with a server containing valuable data. Some of these tests may have undesirable side-effects on roles or other global objects within the tested server. "make installcheck-world" at the top level does not recurse into this directory. Most extensions have their own pg_regress tests or isolationtester specs. Some are also used by tests elsewhere in the tree. If you're adding new hooks or other functionality exposed as C-level API this is where to add the tests for it.