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.98.2) (envelope-from ) id 1xT1bO-000000002vl-0VyN for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Nov 2026 18:38:50 +0000 Received: from localhost ([127.0.0.1]:43322 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xT1aN-00000000fLS-09NE for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Nov 2026 18:37:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:54698) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xT1aM-00000000fLK-3Jc8 for pgsql-bugs@lists.postgresql.org; Mon, 16 Nov 2026 18:37:46 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xT1aK-000000002GM-1e8g for pgsql-bugs@lists.postgresql.org; Mon, 16 Nov 2026 18:37:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AGIbgdR123992; Mon, 16 Nov 2026 13:37:42 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AGIbgdR123992 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1794854262; bh=vZIGrc8uYPLhdlfYG19mfeMTtWIlJlgEOBh1gEcRaF4=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=Y82IiF7vAqUWYSbN6sCeBoXHq4IklXoqNHNUFbIH8WHB4m5Li6r+3oYZBzCo3EVjS xw/0ZG1Z8p24DCtBHTJhdxLAo2nTvVZC5I83dX97yMxxPf0IymwBvJDGi9K3fdBEIT SMxSZAFUnEp46T+amRQAKevurRAB8wlGyoQ9fHAI= From: Tom Lane To: Daniel Gustafsson cc: hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19905: loread() with length near INT_MAX: "invalid memory alloc request size" (int32 overflow) In-reply-to: References: <19905-3f33374cbee82db1@postgresql.org> Comments: In-reply-to Daniel Gustafsson message dated "Mon, 16 Nov 2026 13:23:11 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <123990.1794854262.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 16 Nov 2026 13:37:42 -0500 Message-ID: <123991.1794854262@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: >> On 15 Nov 2026, at 05:49, PG Bug reporting form wrote: >> Clamping len >> to MaxAllocSize - VARHDRSZ (or raising "requested length too large" bef= ore >> 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 h= ad a > look at it I think we should error out like lo_get(). Is it really worth the trouble at all? (It's not just your time to commit this, it's that you're loading more work on the translators.) I don't see any non-nefarious case in which we'd hit this error, so letting the palloc error come out seems fine to me. regards, tom lane