pgsql: Fix bogus handling of control characters in json_lex_string().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bogus handling of control characters in json_lex_string().
Date: 2012-06-05 00:44:03
Message-ID: E1SbhsR-0005dY-Op@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix bogus handling of control characters in json_lex_string().

The original coding misbehaved if "char" is signed, and also made the
extremely poor decision to print control characters literally when trying
to complain about them. Report and patch by Shigeru Hanada.

In passing, also fix core dump risk in report_parse_error() should the
parse state be something other than what it expects.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3dd8e596812e3adb72aecafb23fbb6a30836c475

Modified Files
--------------
src/backend/utils/adt/json.c | 8 ++++----
src/test/regress/expected/json.out | 3 +--
2 files changed, 5 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2012-06-05 11:13:34 Re: pgsql: pg_basebackup: Error message improvements.
Previous Message Tom Lane 2012-06-05 00:13:54 pgsql: Fix some more bugs in contrib/xml2's xslt_process().