gnutls_ext_register causing memory corruption

Simon Josefsson simon at josefsson.org
Mon Jun 8 18:43:23 CEST 2009


Of course, the patch should be as below.  I have confirmed this bug, and
written a self-test for it:

http://git.savannah.gnu.org/cgit/gnutls.git/tree/tests/init_roundtrip.c

It crashes with GnuTLS 2.8.x.

diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c
index e4e536f..8fe2edd 100644
--- a/lib/gnutls_extensions.c
+++ b/lib/gnutls_extensions.c
@@ -331,6 +331,8 @@ void
 _gnutls_ext_deinit (void)
 {
   gnutls_free (extfunc);
+  extfunc = NULL;
+  extfunc_size = 0;
 }
 
 /**

/Simon





More information about the Gnutls-devel mailing list