aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/tsgistidx.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-09-04 14:55:37 +0900
committerMichael Paquier <michael@paquier.xyz>2023-09-04 14:55:37 +0900
commitae10dbb0c5e09bff9e26412de7940271ef501164 (patch)
treea549220737f46d58fed2154ae409946160c81b0f /src/backend/utils/adt/tsgistidx.c
parente70ed4b1b87d22b47955c2bdee567ef8424e6df8 (diff)
downloadpostgresql-ae10dbb0c5e09bff9e26412de7940271ef501164.tar.gz
postgresql-ae10dbb0c5e09bff9e26412de7940271ef501164.zip
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
Diffstat (limited to 'src/backend/utils/adt/tsgistidx.c')
-rw-r--r--src/backend/utils/adt/tsgistidx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c
index f0cd2866ff5..12a4111e99a 100644
--- a/src/backend/utils/adt/tsgistidx.c
+++ b/src/backend/utils/adt/tsgistidx.c
@@ -730,7 +730,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
size_alpha = SIGLENBIT(siglen) -
sizebitvec((cache[j].allistrue) ?
GETSIGN(datum_l) :
- GETSIGN(cache[j].sign),
+ cache[j].sign,
siglen);
}
else
@@ -744,7 +744,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
size_beta = SIGLENBIT(siglen) -
sizebitvec((cache[j].allistrue) ?
GETSIGN(datum_r) :
- GETSIGN(cache[j].sign),
+ cache[j].sign,
siglen);
}
else