1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-22 02:52:08 +03:00

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
This commit is contained in:
Tomas Vondra
2021-04-14 00:46:12 +02:00
parent 60f1f09ff4
commit 20661c15db

View File

@ -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);