Re: BUG #19905: loread() with length near INT_MAX: "invalid memory alloc request size" (int32 overflow)

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: hackerzheng666(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19905: loread() with length near INT_MAX: "invalid memory alloc request size" (int32 overflow)
Date: 2026-11-16 12:23:11
Message-ID: B5B036C4-8812-4C8C-A28A-23704BF2F857@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 15 Nov 2026, at 05:49, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:

> Clamping len
> to MaxAllocSize - VARHDRSZ (or raising "requested length too large" before
> the allocation, as lo_get() style paths do) would give a proper message.

As far as bugs go, this is pretty low on the prioritylist; but since I had a
look at it I think we should error out like lo_get().

--
Daniel Gustafsson

Attachment Content-Type Size
loread.diff application/octet-stream 568 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-11-16 12:24:25 BUG #19907: INSERT through partitioned table fails with domain-typed generated column
Previous Message Nisha Moond 2026-11-16 12:19:26 Re: BUG #19892: Logical replication skips UPDATE/DELETE of rows with NULL in a hash-indexed subscriber column