Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u6DwL-00Cs2y-Fx for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Apr 2025 19:33:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u6DwJ-000wFn-J8 for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Apr 2025 19:33:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u6DwJ-000wFf-0s for pgsql-bugs@lists.postgresql.org; Sat, 19 Apr 2025 19:33:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u6DwH-000uct-1d for pgsql-bugs@lists.postgresql.org; Sat, 19 Apr 2025 19:33:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 53JJXKkH037901; Sat, 19 Apr 2025 15:33:21 -0400 From: Tom Lane To: d.kovalenko@postgrespro.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18896: A potential problem in heap_page_items (pageinspect, PG-17) In-reply-to: <18896-add267b8e06663e3@postgresql.org> References: <18896-add267b8e06663e3@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 16 Apr 2025 20:21:16 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <37899.1745091200.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 19 Apr 2025 15:33:20 -0400 Message-ID: <37900.1745091200@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Please, look at this code in heap_page_items function: > https://github.com/postgres/postgres/blob/11ff192b5bb707ba9ec13a0b6c7468= 874403abb3/contrib/pageinspect/heapfuncs.c#L231-L248 > If lp_len value is less than tuphdr->t_hoff, we get a problem with negat= ive > 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 <=3D lp_len ....) > section. Agreed, that looks like a good fix. I'll make it so. regards, tom lane