pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ma100@hotmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18853: integer may overflow in array_user_functions
Date: Tue, 18 Mar 2025 09:58:05 -0400
Message-ID: <17181.1742306285@sss.pgh.pa.us> (raw)
In-Reply-To: <18853-46697b88110224a7@postgresql.org>
References: <18853-46697b88110224a7@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I noticed that in the array_userfunc.c file, there are many calculations
> involving int32 without overflow checks. 

> For example: 
> int reqsize = state1->nbytes + state2->nbytes; 

This particular example is expected not to overflow because Datum
sizes are restricted to be < 1GB.  There may indeed be live overflow
hazards in array_userfunc.c (or elsewhere), but you will need a
considerably more sophisticated analysis to demonstrate it.

			regards, tom lane





view thread (2+ messages)

Message-ID: <17181.1742306285@sss.pgh.pa.us>
Permalink:  ../17181.1742306285@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17181.1742306285@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ma100@hotmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18853: integer may overflow in array_user_functions
  In-Reply-To: <17181.1742306285@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox