The OpenSSL code in libpq have two issues for multithreading: the verify_cb
callback use a global variable to pass back error detail state and there is one
use of strerror().

The attached fixes both, with no functional change, in order to pave the way
for multithreading:

  * Rather than using a global variable the callback use a new member in the
  Port struct for passing the string, and the Port struct is in turn passed as
  private data in the SSL object
  * The strerror call is replaced with a strerror_r call using the already
  existing errorbuffer

These were tested on OpenSSL 1.1.1 through 3.5.  Parking this in the next
commitfest.

--
Daniel Gustafsson

Attachment: 0001-libpq-Fix-multithreading-issues-in-the-OpenSSL-suppo.patch
Description: Binary data

Reply via email to