Fix AddressSanitizer use-after-scope complaint.

XLogRegisterBufData() does not copy data pointed to by caller's pointer
argument.

Oversight in commit 0d861bbb70.

Author: Peter Eisentraut
Reported-By: Peter Eisentraut
Discussion: https://postgr.es/m/21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com
This commit is contained in:
Peter Geoghegan 2020-04-30 12:31:56 -07:00
parent 30e82f1bc9
commit dd1f645cc8
1 changed files with 2 additions and 1 deletions

View File

@ -1289,6 +1289,7 @@ _bt_insertonpg(Relation rel,
xl_btree_metadata xlmeta;
uint8 xlinfo;
XLogRecPtr recptr;
uint16 upostingoff;
xlrec.offnum = newitemoff;
@ -1354,7 +1355,7 @@ _bt_insertonpg(Relation rel,
* must reconstruct final itup (as well as nposting) using
* _bt_swap_posting().
*/
uint16 upostingoff = postingoff;
upostingoff = postingoff;
XLogRegisterBufData(0, (char *) &upostingoff, sizeof(uint16));
XLogRegisterBufData(0, (char *) origitup,