Skip to content

Commit ae10dbb

Browse files
committed
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 140d4eb, 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
1 parent e70ed4b commit ae10dbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/tsgistidx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
730730
size_alpha = SIGLENBIT(siglen) -
731731
sizebitvec((cache[j].allistrue) ?
732732
GETSIGN(datum_l) :
733-
GETSIGN(cache[j].sign),
733+
cache[j].sign,
734734
siglen);
735735
}
736736
else
@@ -744,7 +744,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
744744
size_beta = SIGLENBIT(siglen) -
745745
sizebitvec((cache[j].allistrue) ?
746746
GETSIGN(datum_r) :
747-
GETSIGN(cache[j].sign),
747+
cache[j].sign,
748748
siglen);
749749
}
750750
else

0 commit comments

Comments
 (0)