Re: BUG #18853: integer may overflow in array_user_functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ma100(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18853: integer may overflow in array_user_functions
Date: 2025-03-18 13:58:05
Message-ID: 17181.1742306285@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:
> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrei Lepikhov 2025-03-18 14:16:36 Re: BUG #18854: PostgreSQL chooses a suboptimal execution plan when using a specific WHERE filter
Previous Message PG Bug reporting form 2025-03-18 11:34:05 BUG #18854: PostgreSQL chooses a suboptimal execution plan when using a specific WHERE filter