Re: Segfault after connecting

Michał Trojnara <[email protected]>
Newsgroups gmane.network.stunnel.user
Message-ID <[email protected]>
On 23.02.2017 23:33, Andrew Culver wrote:
> Tried 5.41b3 and it's no longer segfaulting. I'll keep an eye out for
> 5.41 stable. Here's the debug log if it should help Peter with his
> workaround:

I think the proper course of action would be to check whether this
change of OpenSSL's behavior was intentional, and submit a bug report
(or propose a fix) if it wasn't.  Implementing a workaround in stunnel
may potentially cause a memory leak.

Peter: Please let me know if you need my help.

The workaround proposed by Peter (with my small improvement) is:

diff --git a/src/ctx.c b/src/ctx.c
index 9f12ded..c4ef866 100644
--- a/src/ctx.c
+++ b/src/ctx.c
@@ -911,7 +911,10 @@ NOEXPORT void sess_remove_cb(SSL_CTX *ctx,
SSL_SESSION *sess) {
     opt=SSL_CTX_get_ex_data(ctx, index_opt);
     if(opt->option.sessiond)
         cache_remove(ctx, sess);
+#if OPENSSL_VERSION_NUMBER<0x10100000L
+    /* OpenSSL before 1.1.0 does not free the session automatically */
     SSL_SESSION_free(sess);
+#endif
 }

Best regards,
	Mike

_______________________________________________
stunnel-users mailing list
[email protected]
https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
signature.asc (application/pgp-signature, 884 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYr9boAAoJEC78f/DUFuAUD/QP/1MiactTW1SlkRrjBinp/Nnt
z8VZOo454+1DbqtVv2m722rz4ia/+XAruIIEsbR0v6Sl6dkzwHqvusQ+bhlRCJmC
PDOe+jc7V7Py5O80UGhiTgwlrmlW+sljImTqkf8C3NgnC1oSivCr125oWX+uJiv4
05LgH9fOQaQ80bcuh0eGNx7Es8W/5BjwP+TGgKhwkKpZaqNTrov3KxBh6xlDXLbz
iR14EtcrLFNNaH/CQmxzNVnT4vM3ru6Vs61tw2YlkTZX7l2WgfnGoktALYSuYvyc
+or+g24CnbO7TfV2tCzc+LlyfxDuR8fQu1gwA6RsoBM7AOSvaF2gDK0gjHGOI1iM
0/K7lpjuBdqCylImTEJue82xDZtXV6Dtjlq+63XNn/h5tW4C/hj7solAXCMQeYcb
gr/zLOjARHPRk3LOCyUWnYbU/eAfs5/lUm34/V/1is51yQQlVlccU2kcazTH58E9
ckmYDpoeuV55amDoP3wkxXldzF6Mri8mF9Go4GN9JukBe2zq2Tfzl5nkwDuS2gKM
gHIMMvWS5NoFwabrXf0ipqRt/OceFtWpMHS1W11ocqPQp7WQ+Rgxff0pGmzragTT
lFCVSZXbFXhCO0RngczdcWVGH2QEILLKywOp6nQIvqQ6tH+i38Z+0Nm2rzcu+BUC
hVKaupLFPus5QXSzctfb
=qogi
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.