pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix out-of-bounds read in json_lex_string
Date: Tue, 12 Jul 2022 04:27:43 +0000
Message-ID: <E1oB7Us-002Nic-BI@gemulon.postgresql.org> (raw)

Fix out-of-bounds read in json_lex_string

Commit 3838fa269 added a lookahead loop to allow building strings multiple
bytes at a time. This loop could exit because it reached the end of input,
yet did not check for that before checking if we reached the end of a
valid string. To fix, put the end of string check back in the outer loop.

Per Valgrind animal skink

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d3117fc1a3e87717a57be0153408e5387e265e1b

Modified Files
--------------
src/common/jsonapi.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1oB7Us-002Nic-BI@gemulon.postgresql.org>
Permalink:  ../E1oB7Us-002Nic-BI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oB7Us-002Nic-BI@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: john.naylor@postgresql.org
  Subject: Re: pgsql: Fix out-of-bounds read in json_lex_string
  In-Reply-To: <E1oB7Us-002Nic-BI@gemulon.postgresql.org>
  References: <E1oB7Us-002Nic-BI@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