aboutsummaryrefslogtreecommitdiff
path: root/src/backend/partitioning/partdesc.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-04-22 16:04:48 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-04-22 16:04:48 -0400
commit43b55ec4bc3bc06596d966391f16defe016310ec (patch)
tree5c56d6ef9bb0f09a8f736c3821ace4606d3d7022 /src/backend/partitioning/partdesc.c
parent84f15ccd4c25c4ffc4de6ed82f7658a3a199a1d7 (diff)
downloadpostgresql-43b55ec4bc3bc06596d966391f16defe016310ec.tar.gz
postgresql-43b55ec4bc3bc06596d966391f16defe016310ec.zip
Fix uninitialized memory bug
Have interested callers of find_inheritance_children set the detached_exist value to false prior to calling it, so that that routine only has to set it true in the rare cases where it is necessary. Don't touch it otherwise. Per buildfarm member thorntail (which reported a UBSan failure here).
Diffstat (limited to 'src/backend/partitioning/partdesc.c')
-rw-r--r--src/backend/partitioning/partdesc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/partitioning/partdesc.c b/src/backend/partitioning/partdesc.c
index 12ef36a73e6..2305dff4077 100644
--- a/src/backend/partitioning/partdesc.c
+++ b/src/backend/partitioning/partdesc.c
@@ -131,6 +131,7 @@ RelationBuildPartitionDesc(Relation rel, bool omit_detached)
* concurrently, whatever this function returns will be accurate as of
* some well-defined point in time.
*/
+ detached_exist = false;
inhoids = find_inheritance_children(RelationGetRelid(rel), omit_detached,
NoLock, &detached_exist);
nparts = list_length(inhoids);