Re: BUG #17858: ExecEvalArrayExpr() leaves uninitialised memory for multidim array with nulls

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17858: ExecEvalArrayExpr() leaves uninitialised memory for multidim array with nulls
Date: 2023-03-26 17:44:41
Message-ID: 3008683.1679852681@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alexander Lakhin <exclusion(at)gmail(dot)com> writes:
> So maybe the fix for the bug can be seen as a supplement for 18c0b4ecc.

Yeah, I agree. Given that precedent, there's little excuse for
ExecEvalArrayExpr not to use palloc0; the fact that it doesn't
already was just an oversight in 18c0b4ecc.

I realized that there's a completely separate way in which
ExecEvalArrayExpr is a few bricks shy of a load: it fails to check
for overflow of the output array size.

Pushed the discussed changes along with a fix for that.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Matthew Bellew 2023-03-26 18:14:44 Parameter marker swapping in {fn timestampdiff()}
Previous Message Tom Lane 2023-03-26 15:41:05 Re: BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results