Skip to content

Commit ad87ba1

Browse files
committed
prevent use-after-free reported by sparc64
1 parent 4b2382b commit ad87ba1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pg_pathman.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,10 @@ create_partitions_internal(Oid relid, Datum value, Oid value_type)
874874
min_rvalue = PrelGetRangesArray(prel)[0].min;
875875
max_rvalue = PrelGetRangesArray(prel)[PrelLastChild(prel)].max;
876876

877+
/* Copy datums on order to protect them from cache invalidation */
878+
min_rvalue = datumCopy(min_rvalue, prel->attbyval, prel->attlen);
879+
max_rvalue = datumCopy(max_rvalue, prel->attbyval, prel->attlen);
880+
877881
/* Retrieve interval as TEXT from tuple */
878882
interval_text = values[Anum_pathman_config_range_interval - 1];
879883

0 commit comments

Comments
 (0)