Fix out-of-bound read in gtsvector_picksplit()

Michael Paquier <michael@paquier.xyz>

Commit: 358cd2b25109f50f2d3a9a29ed90fed9dc362df3
Author: Michael Paquier <michael@paquier.xyz>
Date: 2023-09-04T05:55:58Z
Releases: 11.22
Fix out-of-bound read in gtsvector_picksplit()

This could lead to an imprecise choice when splitting an index page of a
GiST index on a tsvector, deciding which entries should remain on the
old page and which entries should move to a new page.

This is wrong since tsearch2 has been moved into core with commit
140d4ebcb46e, so backpatch all the way down.  This error has been
spotted by valgrind.

Author: Alexander Lakhin
Discussion: https://postgr.es/m/17950-6c80a8d2b94ec695@postgresql.org
Backpatch-through: 11

Files

PathChange+/−
src/backend/utils/adt/tsgistidx.c modified +2 −2

Discussion