Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pecum-0002X8-1F for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Mar 2023 14:24:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pecuk-0002aF-VG for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Mar 2023 14:24:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pecuk-0002a5-Mk for pgsql-bugs@lists.postgresql.org; Tue, 21 Mar 2023 14:24:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pecud-0007NC-Tq for pgsql-bugs@lists.postgresql.org; Tue, 21 Mar 2023 14:24:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32LEOSKt1216376; Tue, 21 Mar 2023 10:24:29 -0400 From: Tom Lane To: Alexander Lakhin cc: Richard Guo , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17858: ExecEvalArrayExpr() leaves uninitialised memory for multidim array with nulls In-reply-to: <4240d86f-7e9f-388b-fd96-f8944860c0f5@gmail.com> References: <17858-8fd287fd3663d051@postgresql.org> <4240d86f-7e9f-388b-fd96-f8944860c0f5@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Tue, 21 Mar 2023 16:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1216374.1679408668.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 21 Mar 2023 10:24:28 -0400 Message-ID: <1216375.1679408668@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > I'm afraid that zeroing only bytes behind nitems bits is not enough, as = outDatum() doesn't bother to calculate the exact = > size of nulls bitmap, it just outputs all bytes of a datum (40 bytes in = that case): In that case, won't padding bytes between array elements also create issues? Seems like we have to just zero the whole array area, like those other functions do. regards, tom lane