mirror of
https://github.com/postgres/postgres.git
synced 2026-02-17 17:55:04 -05:00
If the regex compiler can see that a regex is unsatisfiable (for example, '$foo') then it may emit an NFA having no arcs. pg_trgm's packGraph function did the wrong thing in this case; it would access off the end of a work array, and with bad luck could produce a corrupted output data structure causing more problems later. This could end with wrong answers or crashes in queries using a pg_trgm GIN or GiST index with such a regex. Fix by not trying to de-duplicate if there aren't at least 2 arcs. Per bug #17830 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17830-57ff5f89bdb02b09@postgresql.org |
||
|---|---|---|
| .. | ||
| data | ||
| expected | ||
| sql | ||
| .gitignore | ||
| Makefile | ||
| pg_trgm--1.0--1.1.sql | ||
| pg_trgm--1.1--1.2.sql | ||
| pg_trgm--1.2--1.3.sql | ||
| pg_trgm--1.3--1.4.sql | ||
| pg_trgm--1.3.sql | ||
| pg_trgm--1.4--1.5.sql | ||
| pg_trgm--1.5--1.6.sql | ||
| pg_trgm.control | ||
| trgm.h | ||
| trgm_gin.c | ||
| trgm_gist.c | ||
| trgm_op.c | ||
| trgm_regexp.c | ||