pgsql: Don't read fields of a misaligned ExpandedObjectHeader orAnyArr
От
Noah Misch
Тема
pgsql: Don't read fields of a misaligned ExpandedObjectHeader orAnyArr
Дата
Msg-id
E1hhkIt-0004A3-CD@gemulon.postgresql.org
Список
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption. Back-patch to 9.5, where AnyArrayType was introduced. Reviewed by Tom Lane. Discussion: https://postgr.es/m/20190629210334.GA1244217@rfd.leadboat.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b664b187d7ea6546ef4e0f32167a93c6a74dca08 Modified Files -------------- src/backend/utils/adt/arrayfuncs.c | 2 +- src/include/utils/array.h | 19 +++++++++++++------ src/include/utils/arrayaccess.h | 4 ++-- src/include/utils/expandeddatum.h | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-)
В списке pgsql-committers по дате отправления
От: Andrew Gierth
Дата: