pgsql: Fix regex match failures for backrefs combined with non-greedy q

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix regex match failures for backrefs combined with non-greedy q
Дата
Msg-id E1UzzQB-00032v-E9@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix regex match failures for backrefs combined with non-greedy quantifiers.

An ancient logic error in cfindloop() could cause the regex engine to fail
to find matches that begin later than the start of the string.  This
function is only used when the regex pattern contains a back reference,
and so far as we can tell the error is only reachable if the pattern is
non-greedy (i.e. its first quantifier uses the ? modifier).  Furthermore,
the actual match must begin after some potential match that satisfies the
DFA but then fails the back-reference's match test.

Reported and fixed by Jeevan Chalke, with cosmetic adjustments by me.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f4ceb7aa56e356da30a8de376a66f0fbcdbf938a

Modified Files
--------------
src/backend/regex/regexec.c |   20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix regex match failures for backrefs combined with non-greedy q
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Add checks for valid multibyte character length in UtfToLocal, L