Re: new regexp_*(text, text, int) functions crash

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: pgsql-hackers@postgresql.org
Date: 2021-09-11T18:42:42Z
Lists: pgsql-hackers
Jaime Casanova <jcasanov@systemguards.com.ec> writes:
> BTW, this only happens when the third parameter is large. Here is an
> example that consistently crash here:
> select regexp_count('jaime.casanova', 'valid', 102481);

Hah ... pg_regexec has never had a check that the search start position
is sane.  Will fix.

			regards, tom lane



Commits

  1. Make pg_regexec() robust against out-of-range search_start.