Fix bogus handling of control characters in json_lex_string().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 5 Jun 2012 00:43:57 +0000 (20:43 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 5 Jun 2012 00:43:57 +0000 (20:43 -0400)
commit3dd8e596812e3adb72aecafb23fbb6a30836c475
tree61d2e9e1b565d0f70704288e0aa60dfaa99c70d0
parentd9b31e4859df5325b7d3d2cc94b0e907f1cf1d3e
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.
src/backend/utils/adt/json.c
src/test/regress/expected/json.out