Re: pg_upgrade segfaults when given an invalid PGSERVICE value

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date: 2013-03-20 16:06:38
Message-ID: 20130320160638.GA13677@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote:
> >so it is clearly possible for PQconndefaults() to return NULL for
> >service file failures. The questions are:
> >
> >* Is this what we want?
>
> What other choices do we have? I don't think PQconndefaults() should
> continue on as if PGSERVICE wasn't set in the environment after a
> failure from parseServiceInfo.

True. Ignoring a service specification seems wrong, and issuing a
warning message weak.

> >* Should we document this?
>
> Yes the documentation should indicate that PQconndefaults() can
> return NULL for more than just memory failures.

The attached patch fixes this. I am unclear about backpatching this as
it hits lot of code, is rare, and adds new translation strings. On the
other hand, it does crash the applications.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
libpq.diff text/x-diff 5.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Cousin 2013-03-20 16:06:42 Re: Problem with background worker
Previous Message Thom Brown 2013-03-20 16:03:23 Re: Call for Google Summer of Code mentors, admins