Re: control character check in JSON type seems broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: control character check in JSON type seems broken
Дата
Msg-id 21413.1338857289@sss.pgh.pa.us
обсуждение исходный текст
Ответ на control character check in JSON type seems broken  (Shigeru Hanada <shigeru.hanada@gmail.com>)
Ответы Re: control character check in JSON type seems broken  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-bugs
Shigeru Hanada <shigeru.hanada@gmail.com> writes:
> json_lex_string() misjudges that the token "キー" contains naked
> (not-escaped) control character, because its first byte is 0xe3 and it's
> -29 for signed char interpreting, and it's less than 32.  We need to
> cast to unsigned char (or use unsigned variable) here.

Yeah, that's wrong.

> In addition, error message above seems corrupted in my environment.
> Here we check not-escaped control character, so printing it with %c
> formatting might break log files.  How about using decimal or hex dump
> in such cases?

And so is that.  IMO the error reporting in this module could stand to
be reviewed altogether for compliance with our message guidelines.
(For starters, why is it using errdetail_internal?)  I refrained from
editorializing on-the-fly, but I'm not too pleased with what I saw.

Patch applied, thanks!

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Calling xlst_process with certain arguments causes server crash
Следующее
От: Dave Page
Дата:
Сообщение: Re: BUG #6652: Installer grants postgres user rights for the whole disk, not specified subfolder