]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assign_record_type_typmod().
authorJeff Davis <jdavis@postgresql.org>
Fri, 9 Jul 2021 21:15:48 +0000 (14:15 -0700)
committerJeff Davis <jdavis@postgresql.org>
Sat, 10 Jul 2021 17:27:27 +0000 (10:27 -0700)
commitedd9a2bf741be95aa771b9fcacb2ce7378fb9121
tree161d70080826f7f246b9647d42fcac85d402cbdd
parent9fca23c1d6de2664aa447e4ef72b9bf60d3bdf35
Fix assign_record_type_typmod().

If an error occurred in the wrong place, it was possible to leave an
unintialized entry in the hash table, leading to a crash. Fixed.

Also, be more careful about the order of operations so that an
allocation error doesn't leak memory in CacheMemoryContext or
unnecessarily advance NextRecordTypmod.

Backpatch through version 11. Earlier versions (prior to 35ea75632a5)
do not exhibit the problem, because an uninitialized hash entry
contains a valid empty list.

Author: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/HE1PR8303MB009069D476225B9A9E194B8891779@HE1PR8303MB0090.EURPRD83.prod.outlook.com
Backpatch-through: 11
src/backend/utils/cache/typcache.c