pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix "path" infrastructure bug affecting jsonb_set()
Date: Fri, 12 Jun 2015 23:27:10 +0000
Message-ID: <E1Z3YLu-00024G-Ti@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix "path" infrastructure bug affecting jsonb_set()

jsonb_set() and other clients of the setPathArray() utility function
could get spurious results when an array integer subscript is provided
that is not within the range of int.

To fix, ensure that the value returned by strtol() within setPathArray()
is within the range of int;  when it isn't, assume an invalid input in
line with existing, similar cases.  The path-orientated operators that
appeared in PostgreSQL 9.3 and 9.4 do not call setPathArray(), and
already independently take this precaution, so no change there.

Peter Geoghegan

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2271d002d5c305441398e8f7a295f18ec3c132a9

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c |    7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1Z3YLu-00024G-Ti@gemulon.postgresql.org>
Permalink:  ../E1Z3YLu-00024G-Ti@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1Z3YLu-00024G-Ti@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: andrew@dunslane.net
  Subject: Re: pgsql: Fix "path" infrastructure bug affecting jsonb_set()
  In-Reply-To: <E1Z3YLu-00024G-Ti@gemulon.postgresql.org>
  References: <E1Z3YLu-00024G-Ti@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