Re: BUG #17830: Incorrect memory access in trgm_regexp

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-03-12T12:00:01Z
Lists: pgsql-bugs
11.03.2023 19:39, Tom Lane wrote:
> Yeah, that de-duplication code is incorrectly assuming that the
> NFA has more than zero arcs, which it doesn't because the regex
> compiler saw that the pattern is unsatisfiable.
>
> Thanks for the report!

I've retested trgm_regexp with all regular expressions presented in
src/test/regress/sql/regex.sql and src/test/modules/test_regex/sql/test_regex.sql
and found no new anomalies.

Thank you for the fix!

Best regards,
Alexander



Commits

  1. Fix misbehavior in contrib/pg_trgm with an unsatisfiable regex.