pgsql: Fix integer overflow bug in GiST buffering build calculations.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix integer overflow bug in GiST buffering build calculations.
Date: 2012-05-29 19:28:58
Message-ID: E1SZS6E-0000rE-Ki@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix integer overflow bug in GiST buffering build calculations.

The result of (maintenance_work_mem * 1024) / BLCKSZ doesn't fit in a signed
32-bit integer, if maintenance_work_mem >= 2GB. Use double instead. And
while we're at it, write the calculations in an easier to understand form,
with the intermediary steps written out and commented.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4bc6fb57f774ea18187fd8565aad9994160bfc17

Modified Files
--------------
src/backend/access/gist/gistbuild.c | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2012-05-29 19:34:20 Re: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Previous Message Tom Lane 2012-05-29 19:00:02 Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value