pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17858: ExecEvalArrayExpr() leaves uninitialised memory for multidim array with nulls
Date: Sun, 26 Mar 2023 13:44:41 -0400
Message-ID: <3008683.1679852681@sss.pgh.pa.us> (raw)
In-Reply-To: <87461d66-e96b-24f8-3e66-1daf937fff98@gmail.com>
References: <17858-8fd287fd3663d051@postgresql.org>
	<CAMbWs48CyDghUckGQbkbAB6uPdfzYS4X4Zkdfooausr5vaV9Bg@mail.gmail.com>
	<4240d86f-7e9f-388b-fd96-f8944860c0f5@gmail.com>
	<1216375.1679408668@sss.pgh.pa.us>
	<CAMbWs4_=kd4-u3Mh3tV+NcHuSGY-9Fax+Ck1ZVzOV0HzJ6dXow@mail.gmail.com>
	<87461d66-e96b-24f8-3e66-1daf937fff98@gmail.com>

Alexander Lakhin <exclusion@gmail.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





view thread (8+ messages)

Message-ID: <3008683.1679852681@sss.pgh.pa.us>
Permalink:  ../3008683.1679852681@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3008683.1679852681@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, exclusion@gmail.com, guofenglinux@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17858: ExecEvalArrayExpr() leaves uninitialised memory for multidim array with nulls
  In-Reply-To: <3008683.1679852681@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