Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2wGa-0083Ri-Uf for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Apr 2025 18:04:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u2wGZ-00FdsN-A7 for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Apr 2025 18:04:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2wGZ-00FdsF-1v for pgsql-bugs@lists.postgresql.org; Thu, 10 Apr 2025 18:04:43 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2wGX-004Yzq-00 for pgsql-bugs@lists.postgresql.org; Thu, 10 Apr 2025 18:04:43 +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 53AI4dj5537551; Thu, 10 Apr 2025 14:04:39 -0400 From: Tom Lane To: dan-eli@mail.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18891: /src/include/lib/simplehash.h possible palloc0 problems In-reply-to: <18891-16499b7cbaf2661a@postgresql.org> References: <18891-16499b7cbaf2661a@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 10 Apr 2025 16:47:44 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <537549.1744308279.1@sss.pgh.pa.us> Date: Thu, 10 Apr 2025 14:04:39 -0400 Message-ID: <537550.1744308279@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > On line 1080 there is an initiallization of array with the usage of palloc0. > On the server side there is no problem as the server version of palloc never > returns NULL. However simplehash is used in some utils: pg_dump, > pg_verifybackup, pg_rewind. It seems these utils use the frontend version of > palloc. Therefore it is required to add a NULL check if FRONTEND macro is > defined. Have you read the frontend version of palloc? regards, tom lane