Re: Missing NULL check after calling ecpg_strdup - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Missing NULL check after calling ecpg_strdup
Date
Msg-id CAJ7c6TOBMfe+rzmk8fyPb5mZfeg=LSeziHJmHiKm+uCsaHUcJg@mail.gmail.com
Whole thread Raw
In response to Re: Missing NULL check after calling ecpg_strdup  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi Michael,

> Should we actually check sqlca_t more seriously if failing one of the
> strdup calls used for the port, host, etc. when attempting the
> connection?  The ecpg_log() assumes that a NULL value equals a
> <DEFAULT>, which would be wrong if we failed one of these allocations
> on OOM.

If I read this correctly, you propose to check if strdup returns an
error and if it does then somehow run extra checks on sqlca_t? Sorry,
I don't follow. Could you please elaborate what you are proposing?



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Changing shared_buffers without restart
Next
From: Dmitry Dolgov
Date:
Subject: Re: Changing shared_buffers without restart