diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2021-04-14 00:46:12 +0200 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2021-04-14 00:46:12 +0200 |
commit | 20661c15db8f430d4880ba685e6b12afa271c1ac (patch) | |
tree | 0e05180d7b9fe57c90516477aaacb2072a2fd274 | |
parent | 60f1f09ff44308667ef6c72fbafd68235e55ae27 (diff) | |
download | postgresql-20661c15db8f430d4880ba685e6b12afa271c1ac.tar.gz postgresql-20661c15db8f430d4880ba685e6b12afa271c1ac.zip |
Initialize t_self and t_tableOid in statext_expressions_load
The function is building a fake heap tuple, but left some of the header
fields (tid and table OID) uninitialized. Per Coverity report.
Reported-by: Ranier Vilela
Discussion: https://postgr.es/m/CAEudQApj6h8tZ0-eP5Af5PKc5NG1YUc7=SdN_99YoHS51fKa0Q@mail.gmail.com
-rw-r--r-- | src/backend/statistics/extended_stats.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 4bbd85f401e..e54e8aa8e0f 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -2420,6 +2420,8 @@ statext_expressions_load(Oid stxoid, int idx) /* Build a temporary HeapTuple control structure */ tmptup.t_len = HeapTupleHeaderGetDatumLength(td); + ItemPointerSetInvalid(&(tmptup.t_self)); + tmptup.t_tableOid = InvalidOid; tmptup.t_data = td; tup = heap_copytuple(&tmptup); |