pgsql: Fix unsafe use of strtol() on a non-null-terminated Text datum.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix unsafe use of strtol() on a non-null-terminated Text datum.
Date: 2016-03-23 14:43:33
Message-ID: E1aik0T-00010w-Gx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix unsafe use of strtol() on a non-null-terminated Text datum.

jsonb_set() could produce wrong answers or incorrect error reports, or in
the worst case even crash, when trying to convert a path-array element into
an integer for use as an array subscript. Per report from Vitaly Burovoy.
Back-patch to 9.5 where the faulty code was introduced (in commit
c6947010ceb42143).

Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/384dfbde19330541f7fb487f9352949aa06c812e

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-03-23 15:00:51 pgsql: Code review for error reports in jsonb_set().
Previous Message Simon Riggs 2016-03-23 11:34:07 pgsql: Change comment to describe correct lock level used