Validate ltree siglen GiST option to be int-aligned

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 8bbd0cce92be98de9f4f727b8bf66fe26e5831ea
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2023-04-23T11:30:09Z
Releases: 16.0
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