Re: new heapcheck contrib module - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: new heapcheck contrib module
Date
Msg-id CAH2-Wz=PVfzuwXO_yPbaj6DMZ214v6EBL_sxd2psedUwXPyU_w@mail.gmail.com
Whole thread Raw
In response to Re: new heapcheck contrib module  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 23, 2020 at 11:51 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>             /* Set up context information about this next tuple */
>             ctx.lp_len = ItemIdGetLength(ctx.itemid);
>             ctx.tuphdr = (HeapTupleHeader) PageGetItem(ctx.page, ctx.itemid);
>             ctx.natts = HeapTupleHeaderGetNatts(ctx.tuphdr);
>
> with absolutely no thought for the possibility that lp_off is out of
> range or not maxaligned.  The checks for a sane lp_len seem to have
> gone missing as well.

That is surprising. verify_nbtree.c has PageGetItemIdCareful() for
this exact reason.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: new heapcheck contrib module
Next
From: Heikki Linnakangas
Date:
Subject: Re: [doc] remove reference to pg_dump pre-8.1 switch behaviour