]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix array allocation bugs in SetExplainExtensionState.
authorRobert Haas <rhaas@postgresql.org>
Thu, 25 Sep 2025 15:43:52 +0000 (11:43 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 25 Sep 2025 15:50:08 +0000 (11:50 -0400)
commit694057d236b114f8c750b996b9ca5b8a07424650
treeeda88aef28c8108a08498986bca63de7a7a1703f
parentcbfcb7b466052518e3ddcc784946aa1cfa3f3460
Fix array allocation bugs in SetExplainExtensionState.

If we already have an extension_state array but see a new extension_id
much larger than the highest the extension_id we've previously seen,
the old code might have failed to expand the array to a large enough
size, leading to disaster. Also, if we don't have an extension array
at all and need to create one, we should make sure that it's big enough
that we don't have to resize it instantly.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: http://postgr.es/m/2949591.1758570711@sss.pgh.pa.us
Backpatch-through: 18
src/backend/commands/explain_state.c