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

Tom Lane <tgl@sss.pgh.pa.us>

Commit: c7c93dd55af5d15e22a7343f15fdf917f61304fb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2017-10-06T16:20:13Z
Releases: 9.5.10
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

Files

PathChange+/−
src/backend/access/transam/clog.c modified +9 −3

Discussion