pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix detection of unfinished Unicode surrogate pair at end of str
Date: Wed, 21 Dec 2016 22:39:57 +0000
Message-ID: <E1cJpYD-0005zJ-0n@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix detection of unfinished Unicode surrogate pair at end of string.

The U&'...' and U&"..." syntaxes silently discarded a surrogate pair
start (that is, a code between U+D800 and U+DBFF) if it occurred at
the very end of the string.  This seems like an obvious oversight,
since we throw an error for every other invalid combination of surrogate
characters, including the very same situation in E'...' syntax.

This has been wrong since the pair processing was added (in 9.0),
so back-patch to all supported branches.

Discussion: https://postgr.es/m/19113.1482337898@sss.pgh.pa.us

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/parser/scan.l | 8 ++++++++
1 file changed, 8 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1cJpYD-0005zJ-0n@gemulon.postgresql.org>
Permalink:  ../E1cJpYD-0005zJ-0n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cJpYD-0005zJ-0n@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix detection of unfinished Unicode surrogate pair at end of str
  In-Reply-To: <E1cJpYD-0005zJ-0n@gemulon.postgresql.org>
  References: <E1cJpYD-0005zJ-0n@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox