Re: patch: garbage error strings in libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jtv(at)xs4all(dot)nl
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: patch: garbage error strings in libpq
Date: 2005-07-05 14:38:53
Message-ID: 12996.1120574333@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

jtv(at)xs4all(dot)nl writes:
> Another approach would have been to make libpq_gettext() preserve errno.

That seems like a far easier, cleaner, and more robust fix than this.

Moreover I don't believe that this approach works either, as the result
of strerror() is not guaranteed still usable after another strerror call
(ie, it can use a static buffer repeatedly), so you'd still have the
problem if libpq_gettext invokes strerror. I suppose that a really
robust solution would involve libpq_gettext saving errno, restoring
errno, and invoking strerror() again ...

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-07-05 14:44:28 Re: Error handling fix in interfaces/libpq/fe-secure.c
Previous Message Michael Fuhr 2005-07-05 14:19:50 pgcrypto volatility and strictness changes