mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-04 16:56:51 +02:00
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
140d4ebcb4
, 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
This commit is contained in:
parent
a67cf94115
commit
40ddb8db9f
@ -728,7 +728,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
|
|||||||
size_alpha = 0;
|
size_alpha = 0;
|
||||||
else
|
else
|
||||||
size_alpha = SIGLENBIT - sizebitvec(
|
size_alpha = SIGLENBIT - sizebitvec(
|
||||||
(cache[j].allistrue) ? GETSIGN(datum_l) : GETSIGN(cache[j].sign)
|
(cache[j].allistrue) ? GETSIGN(datum_l) : cache[j].sign
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -740,7 +740,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
|
|||||||
size_beta = 0;
|
size_beta = 0;
|
||||||
else
|
else
|
||||||
size_beta = SIGLENBIT - sizebitvec(
|
size_beta = SIGLENBIT - sizebitvec(
|
||||||
(cache[j].allistrue) ? GETSIGN(datum_r) : GETSIGN(cache[j].sign)
|
(cache[j].allistrue) ? GETSIGN(datum_r) : cache[j].sign
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user