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 1uBx2H-008dLE-NW for pgsql-bugs@arkaria.postgresql.org; Mon, 05 May 2025 14:43:14 +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 1uBx2G-004Ipo-57 for pgsql-bugs@arkaria.postgresql.org; Mon, 05 May 2025 14:43:12 +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 1uBx2F-004Ipf-TI for pgsql-bugs@lists.postgresql.org; Mon, 05 May 2025 14:43:11 +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 1uBx2D-000I0p-0k for pgsql-bugs@lists.postgresql.org; Mon, 05 May 2025 14:43:11 +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 545Eh7Vw2643585; Mon, 5 May 2025 10:43:07 -0400 From: Tom Lane To: gorcom2012@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18910: DEREF_OF_NULL.RET Pointer, returned from function 'palloc0' at simplehash.h:1080, may be NULL In-reply-to: <18910-d074a42367253385@postgresql.org> References: <18910-d074a42367253385@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 05 May 2025 08:00:12 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2643583.1746456187.1@sss.pgh.pa.us> Date: Mon, 05 May 2025 10:43:07 -0400 Message-ID: <2643584.1746456187@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: > In the file /src/include/lib/simplehash.h, within the SH_STAT() function, > there is a call to palloc0() that may return NULL: > uint32 *collisions = (uint32 *) palloc0(tb->size * sizeof(uint32)); palloc and its variants do not return NULL, unless you specify MCXT_ALLOC_NO_OOM, which this call does not. regards, tom lane