Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shruthi Gowda <gowdashru(at)gmail(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL
Date: 2025-12-08 16:09:55
Message-ID: 3007317.1765210195@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shruthi Gowda <gowdashru(at)gmail(dot)com> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vitaly Davydov 2025-12-08 16:39:46 RE: Newly created replication slot may be invalidated by checkpoint
Previous Message Bryan Green 2025-12-08 15:55:41 Re: [PATCH] Allow complex data for GUC extra.