diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-11-06 10:29:17 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-11-06 10:29:41 -0500 |
commit | 70846ee0597b4aabc11ffe252eb972de6f77a021 (patch) | |
tree | 503f3d04d782a35078a5c33f078165ed6dd29260 /src/tutorial/complex.c | |
parent | 29d06705194396d46004a48bf56e741c79269790 (diff) | |
download | postgresql-70846ee0597b4aabc11ffe252eb972de6f77a021.tar.gz postgresql-70846ee0597b4aabc11ffe252eb972de6f77a021.zip |
Make json{b}_populate_recordset() use the right tuple descriptor.
json{b}_populate_recordset() used the tuple descriptor created from the
query-level AS clause without worrying about whether it matched the actual
input record type. If it didn't, that would usually result in a crash,
though disclosure of server memory contents seems possible as well, for a
skilled attacker capable of issuing crafted SQL commands. Instead, use
the query-supplied descriptor only when there is no input tuple to look at,
and otherwise get a tuple descriptor based on the input tuple's own type
marking. The core code will detect any type mismatch in the latter case.
Michael Paquier and Tom Lane, per a report from David Rowley.
Back-patch to 9.3 where this functionality was introduced.
Security: CVE-2017-15098
Diffstat (limited to 'src/tutorial/complex.c')
0 files changed, 0 insertions, 0 deletions