pgsql: Fix access-off-end-of-array in clog.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix access-off-end-of-array in clog.c.
Date: 2017-10-06 16:20:44
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix access-off-end-of-array in clog.c.

Sloppy loop coding in set_status_by_pages() resulted in fetching one array
element more than it should from the subxids[] array. The odds of this
resulting in SIGSEGV are pretty small, but we've certainly seen that happen
with similar mistakes elsewhere. While at it, we can get rid of an extra
TransactionIdToPage() calculation per loop.

Per report from David Binderman. Back-patch to all supported branches,
since this code is quite old.

Discussion: https://postgr.es/m/HE1PR0802MB2331CBA919CBFFF0C465EB429C710@HE1PR0802MB2331.eurprd08.prod.outlook.com

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d45fb6e9d8ca02c4e047d43cb493066a372256d3

Modified Files
--------------
src/backend/access/transam/clog.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-10-06 16:47:49 Re: pgsql: Basic partition-wise join functionality.
Previous Message Tom Lane 2017-10-06 16:20:43 pgsql: Fix access-off-end-of-array in clog.c.