pgsql: Guard against possible memory allocation botch in batchmemtuples

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Guard against possible memory allocation botch in batchmemtuples
Date: 2016-09-06 19:50:50
Message-ID: E1bhMOQ-0000Wq-GJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Guard against possible memory allocation botch in batchmemtuples().

Negative availMemLessRefund would be problematic. It's not entirely
clear whether the case can be hit in the code as it stands, but this
seems like good future-proofing in any case. While we're at it,
insist that the value be not merely positive but not tiny, so as to
avoid doing a lot of repalloc work for little gain.

Peter Geoghegan

Discussion: <CAM3SWZRVkuUB68DbAkgw=532gW0f+fofKueAMsY7hVYi68MuYQ(at)mail(dot)gmail(dot)com>

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/96ba40c0f15aa1e950b35536387fde30ebbc4547

Modified Files
--------------
src/backend/utils/sort/tuplesort.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-09-06 21:51:06 pgsql: Doc: small improvements for documentation about VACUUM freezing.
Previous Message Tom Lane 2016-09-06 18:53:41 pgsql: Teach appendShellString() to not quote strings containing "-".