Validate ltree siglen GiST option to be int-aligned

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 48c6825d0ec8a5021e95aea666944e9345ceb77d
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2023-04-23T11:00:16Z
Releases: 13.11
Validate ltree siglen GiST option to be int-aligned

Unaligned siglen could lead to an unaligned access to subsequent key fields.

Backpatch to 13, where opclass options were introduced.

Reported-by:  Alexander Lakhin
Bug: 17847
Discussion: https://postgr.es/m/17847-171232970bea406b%40postgresql.org
Reviewed-by: Tom Lane, Pavel Borisov, Alexander Lakhin
Backpatch-through: 13

Files

PathChange+/−
contrib/ltree/expected/ltree.out modified +7 −2
contrib/ltree/ltree_gist.c modified +16 −1
contrib/ltree/sql/ltree.sql modified +2 −0
doc/src/sgml/ltree.sgml modified +2 −1

Documentation touched

Discussion