From a2ad11452ac8c8036981bcfa5777ad7c5068aa4a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 2 Sep 2024 11:08:13 +0200 Subject: [PATCH 2/2] Avoid strerror() Replace one strerror() with strerror_r(), mirroring the equivalent code in frontend libpq. --- src/backend/libpq/be-secure-openssl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 60cf5d16e74..a04a514bff9 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -1456,7 +1456,7 @@ static const char * SSLerrmessage(unsigned long ecode) { const char *errreason; - static char errbuf[36]; + static char errbuf[128]; if (ecode == 0) return _("no SSL error reported"); @@ -1473,7 +1473,10 @@ SSLerrmessage(unsigned long ecode) */ #ifdef ERR_SYSTEM_ERROR if (ERR_SYSTEM_ERROR(ecode)) - return strerror(ERR_GET_REASON(ecode)); + { + strerror_r(ERR_GET_REASON(ecode), errbuf, sizeof(errbuf)); + return errbuf; + } #endif /* No choice but to report the numeric ecode */ -- 2.46.0