pgsql: Avoid character classification in regex escape parsing.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid character classification in regex escape parsing.
Date: 2023-04-21 15:31:40
Message-ID: E1ppsjb-004B7k-LM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid character classification in regex escape parsing.

For regex escape sequences, just test directly for the relevant ASCII
characters rather than using locale-sensitive character
classification.

This fixes an assertion failure when a locale considers a non-ASCII
character, such as "൧", to be a digit.

Reported-by: Richard Guo
Discussion: https://postgr.es/m/CAMbWs49Q6UoKGeT8pBkMtJGJd+16CBFZaaWUk9Du+2ERE5g_YA@mail.gmail.com
Backpatch-through: 11

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5bcb15b8163a38f4875372888160628d4d872404

Modified Files
--------------
src/backend/regex/regc_lex.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2023-04-21 15:31:45 pgsql: Avoid character classification in regex escape parsing.
Previous Message Jeff Davis 2023-04-21 15:31:36 pgsql: Avoid character classification in regex escape parsing.