Error handling fix in interfaces/libpq/fe-secure.c - Mailing list pgsql-patches

From jtv@xs4all.nl
Subject Error handling fix in interfaces/libpq/fe-secure.c
Date
Msg-id 14242.202.47.227.25.1120568743.squirrel@202.47.227.25
Whole thread Raw
Responses Re: Error handling fix in interfaces/libpq/fe-secure.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Error handling fix in interfaces/libpq/fe-secure.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Here's another one similar to what I described in my previous message.  In
libpq's pqsecure_read(), if SSL_read() returns -1 and sets an error of
SSL_ERROR_SYSCALL, errno may be polluted by libpq_gettext() before a
human-readable string is derived from it.  Also, pqReadData() will see the
wrong errno value after the call.

The attached patch fixes both by introducing a named variable to hold the
significant value of errno.


Jeroen

Attachment

pgsql-patches by date:

Previous
From: jtv@xs4all.nl
Date:
Subject: patch: garbage error strings in libpq
Next
From: Michael Fuhr
Date:
Subject: Re: Python setof patch