Re: BUG #18896: A potential problem in heap_page_items (pageinspect, PG-17)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: d(dot)kovalenko(at)postgrespro(dot)ru
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18896: A potential problem in heap_page_items (pageinspect, PG-17)
Date: 2025-04-19 19:33:20
Message-ID: 37900.1745091200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Please, look at this code in heap_page_items function:
> https://github.com/postgres/postgres/blob/11ff192b5bb707ba9ec13a0b6c7468874403abb3/contrib/pageinspect/heapfuncs.c#L231-L248
> If lp_len value is less than tuphdr->t_hoff, we get a problem with negative
> value in tuple_data_len

Yeah, you're right.

> I think, we should move the code of /* Copy raw tuple data into bytea
> attribute */ into the next if (.... tuphdr->t_hoff <= lp_len ....)
> section.

Agreed, that looks like a good fix. I'll make it so.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Shawn McCoy 2025-04-18 21:22:00 Disabled logical replication origin session causes primary key errors