Re: BUG #16814: Invalid memory access on regexp_match with .* and BRE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16814: Invalid memory access on regexp_match with .* and BRE
Дата
Msg-id 323716.1610126386@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16814: Invalid memory access on regexp_match with .* and BRE  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> When executing the following regexp call:
> select regexp_match('abc', '.*', 'b');
> valgrind detects an error:

Hah, nice one.  It gives the wrong answer too, at least it does most of
the time for me:

# select regexp_match('abc', '.*', 'b');
 regexp_match 
--------------
 {""}
(1 row)

That's because it's acting like the pattern is '.*?' (prefer shortest
match) rather than '.*'.

This bug is well over the age of consent, btw.  Tcl's got it too,
so it surely is aboriginal in Henry Spencer's code.

Thanks for the report!

            regards, tom lane



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Jeroen Baten
Дата:
Сообщение: Re: BUG #16816: Unexpected escaping of html output
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16815: Unable to use the X448 an X25519 elliptic curves.