Re: improve ssl error code, 2147483650
От | Peter Eisentraut |
---|---|
Тема | Re: improve ssl error code, 2147483650 |
Дата | |
Msg-id | 27eaa2e1-64a5-48a1-986e-bbf24672b365@eisentraut.org обсуждение исходный текст |
Ответ на | Re: improve ssl error code, 2147483650 (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: improve ssl error code, 2147483650
Re: improve ssl error code, 2147483650 |
Список | pgsql-hackers |
On 08.03.24 01:46, Tom Lane wrote: > Daniel Gustafsson <daniel@yesql.se> writes: >> On 7 Mar 2024, at 20:58, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> This could probably do with a comment, and we need to propagate >>> the fix into libpq's copy of the function too. Barring objections, >>> I'll take care of that and push it later today. > >> LGTM. > > Done so far as be-secure-openssl.c and fe-secure-openssl.c are > concerned. I noticed that this change uses not-thread-safe strerror() in libpq code. Perhaps something like this would be better (and simpler): diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c index 5c867106fb0..14cd9ce404d 100644 --- a/src/interfaces/libpq/fe-secure-openssl.c +++ b/src/interfaces/libpq/fe-secure-openssl.c @@ -1767,7 +1767,7 @@ SSLerrmessage(unsigned long ecode) #ifdef ERR_SYSTEM_ERROR if (ERR_SYSTEM_ERROR(ecode)) { - strlcpy(errbuf, strerror(ERR_GET_REASON(ecode)), SSL_ERR_LEN); + strerror_r(ERR_GET_REASON(ecode), errbuf, SSL_ERR_LEN); return errbuf; } #endif
В списке pgsql-hackers по дате отправления: