]> granicus.if.org Git - postgresql/commit
Fix unsafe use of strtol() on a non-null-terminated Text datum.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Mar 2016 14:43:13 +0000 (10:43 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Mar 2016 14:43:13 +0000 (10:43 -0400)
commit384dfbde19330541f7fb487f9352949aa06c812e
tree953af993af200021087f0b3adcd1569b75f6857b
parent8320c625d983f4cf4c8f453165502d7cf3aa7cf3
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
src/backend/utils/adt/jsonfuncs.c