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.96) (envelope-from ) id 1vSdoG-002UBe-0a for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2025 16:10:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSdoE-000Skv-1H for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2025 16:09:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSdoE-000Skn-0K for pgsql-hackers@lists.postgresql.org; Mon, 08 Dec 2025 16:09:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSdoB-003mY2-2w for pgsql-hackers@postgresql.org; Mon, 08 Dec 2025 16:09:57 +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 5B8G9tUj3007318; Mon, 8 Dec 2025 11:09:55 -0500 From: Tom Lane To: Shruthi Gowda cc: PostgreSQL Development Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL In-reply-to: References: Comments: In-reply-to Shruthi Gowda message dated "Mon, 08 Dec 2025 21:08:56 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3007316.1765210195.1@sss.pgh.pa.us> Date: Mon, 08 Dec 2025 11:09:55 -0500 Message-ID: <3007317.1765210195@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Shruthi Gowda writes: > The ECPG application crashes with a segmentation fault when calling > specific deallocation or prepared statement functions without an > established database connection. This is caused by a missing NULL check on > the connection handle before attempting to access it. Hmm ... poking around, I see several other places that aren't checking the result of ecpg_get_connection. Shouldn't we tighten them all? regards, tom lane