aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-07-21 12:24:14 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-07-21 12:25:14 -0400
commite06d1a88f3003bbff96ba052e5ba2366265db623 (patch)
treee774b1220538dfb7ffdccfba2125d8fce82ee55b /src/backend/access/gist
parent92591c4c8fb4f1d454baf3fd3f3e8f44793f5b95 (diff)
downloadpostgresql-e06d1a88f3003bbff96ba052e5ba2366265db623.tar.gz
postgresql-e06d1a88f3003bbff96ba052e5ba2366265db623.zip
Fix PQsetvalue() to avoid possible crash when adding a new tuple.
PQsetvalue unnecessarily duplicated the logic in pqAddTuple, and didn't duplicate it exactly either --- pqAddTuple does not care what is in the tuple-pointer array positions beyond the last valid entry, whereas the code in PQsetvalue assumed such positions would contain NULL. This led to possible crashes if PQsetvalue was applied to a PGresult that had previously been enlarged with pqAddTuple, for instance one built from a server query. Fix by relying on pqAddTuple instead of duplicating logic, and not assuming anything about the contents of res->tuples[res->ntups]. Back-patch to 8.4, where PQsetvalue was introduced. Andrew Chernow
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions