pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Guard against possible memory allocation botch in batchmemtuples
Date: Tue, 06 Sep 2016 19:50:50 +0000
Message-ID: <E1bhMOQ-0000Wp-GG@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@mail.gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f032722f86a709277d44a317a3bc8acd74861a72

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


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (2+ messages)

Message-ID: <E1bhMOQ-0000Wp-GG@gemulon.postgresql.org>
Permalink:  ../E1bhMOQ-0000Wp-GG@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bhMOQ-0000Wp-GG@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Guard against possible memory allocation botch in batchmemtuples
  In-Reply-To: <E1bhMOQ-0000Wp-GG@gemulon.postgresql.org>
  References: <E1bhMOQ-0000Wp-GG@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox