Author: dsahlberg
Date: Sun Jul 20 10:02:50 2025
New Revision: 1927348

URL: http://svn.apache.org/viewvc?rev=1927348&view=rev
Log:
Revert half of r1927273, ERR_error_string isn't threadsafe so we need to make
an extra copy to local stack space.

* buckets/ssl_buckets.c
  (log_ssl_error): Revert back to using ERR_error_string_n to make a copy
    of the error message string.

Found by: brane/minfrin

Modified:
    serf/trunk/buckets/ssl_buckets.c

Modified: serf/trunk/buckets/ssl_buckets.c
URL: 
http://svn.apache.org/viewvc/serf/trunk/buckets/ssl_buckets.c?rev=1927348&r1=1927347&r2=1927348&view=diff
==============================================================================
--- serf/trunk/buckets/ssl_buckets.c (original)
+++ serf/trunk/buckets/ssl_buckets.c Sun Jul 20 10:02:50 2025
@@ -362,8 +362,9 @@ static void log_ssl_error(serf_ssl_conte
     while ((err = ERR_get_error())) {
 
         if (err && ctx->error_callback) {
-            char *errstr = ERR_error_string(err, NULL);
-            ctx->error_callback(ctx->error_baton, ctx->fatal_err, errstr);
+            char ebuf[256];
+            ERR_error_string_n(err, ebuf, sizeof(ebuf));
+            ctx->error_callback(ctx->error_baton, ctx->fatal_err, ebuf);
         }
 
     }


Reply via email to