pgsql: Only adjust negative indexes in json_get up to the length of the

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Only adjust negative indexes in json_get up to the length of the
Date: 2015-07-28 21:59:30
Message-ID: E1ZKCuI-00078i-Hg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Only adjust negative indexes in json_get up to the length of the path.

The previous code resulted in memory access beyond the path bounds. The
cure is to move it into a code branch that checks the value of lex_level
is within the correct bounds.

Bug reported and diagnosed by Piotr Stefaniak.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6d10f4e9d7f0051afb60c42409f2fe61cf4da348

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-07-28 22:43:55 pgsql: Update our documentation concerning where to create data directo
Previous Message Tom Lane 2015-07-28 21:34:34 pgsql: Reduce chatter from signaling of autovacuum workers.