diff options
author | Thomas Munro <tmunro@postgresql.org> | 2023-09-13 14:32:24 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2023-09-13 14:48:00 +1200 |
commit | 189097db822de17dc1a501fe57f4db5fdd739e18 (patch) | |
tree | 3c545a86c24f62143d5361da750db59e53da256a /src/backend/access/gist/gistproc.c | |
parent | c570bb4d61b6b1225c157252c65af538834136f2 (diff) | |
download | postgresql-189097db822de17dc1a501fe57f4db5fdd739e18.tar.gz postgresql-189097db822de17dc1a501fe57f4db5fdd739e18.zip |
Fix exception safety bug in typcache.c.
If an out-of-memory error was thrown at an unfortunate time,
ensure_record_cache_typmod_slot_exists() could leak memory and leave
behind a global state that produced an infinite loop on the next call.
Fix by merging RecordCacheArray and RecordIdentifierArray into a single
array. With only one allocation or re-allocation, there is no
intermediate state.
Back-patch to all supported releases.
Reported-by: "James Pang (chaolpan)" <chaolpan@cisco.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/PH0PR11MB519113E738814BDDA702EDADD6EFA%40PH0PR11MB5191.namprd11.prod.outlook.com
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions