]> granicus.if.org Git - postgresql/commit
Fix use-after-free around DISTINCT transition function calls.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 17 Oct 2016 09:13:16 +0000 (12:13 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 17 Oct 2016 09:13:35 +0000 (12:13 +0300)
commita5f0bd77a2fab60a52dc335a63efc21abc806aa7
tree637bcc342da1bf8b564f38fd8023ce9869a02ebe
parentdb4b54f1550aa830890ce190e5d196de8d17db33
Fix use-after-free around DISTINCT transition function calls.

Have tuplesort_gettupleslot() copy the contents of its current table slot
as needed. This is based on an approach taken by tuplestore_gettupleslot().
In the future, tuplesort_gettupleslot() may also be taught to avoid copying
the tuple where caller can determine that that is safe (the
tuplestore_gettupleslot() interface already offers this option to callers).

Patch by Peter Geoghegan. Fixes bug #14344, reported by Regina Obe.

Report: <20160929035538.20224.39628@wrigleys.postgresql.org>

Backpatch-through: 9.6
src/backend/utils/sort/tuplesort.c