Re: Bug in jsonb_in function (14 & 15 version are affected)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in jsonb_in function (14 & 15 version are affected)
Date: 2023-03-13 17:58:02
Message-ID: 2000262.1678730282@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikolay Shaplov <dhyan(at)nataraj(dot)su> writes:
> I found a bug in jsonb_in function (it converts json from sting representation
> into jsonb internal representation).

Yeah. Looks like json_lex_string is failing to honor the invariant
that it needs to set token_terminator ... although the documentation
of the function certainly isn't helping. I think we need the attached.

A nice side benefit is that the error context reports get a lot more
useful --- somebody should have inquired before as to why they were
so bogus.

regards, tom lane

Attachment Content-Type Size
fix-json-lex-string-error-cases.patch text/x-diff 18.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-03-13 18:04:32 Re: meson: Non-feature feature options
Previous Message Yurii Rashkovskii 2023-03-13 17:48:26 Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name