[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated (dd9aadce -> 13fe4565)

From: gnunet
Subject: [libmicrohttpd] branch master updated (dd9aadce -> 13fe4565)
Date: Thu, 22 Oct 2020 16:24:35 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from dd9aadce Merge branch 'master' of git+ssh://
     new 53fec1c2 daemon.c: fixed leaked on error GnuTLS resource
     new 13fe4565 new_connection_prepare_(): added check for valid TLS 

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.

Summary of changes:
 src/microhttpd/daemon.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index b18885f0..98b93ae5 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2535,10 +2535,26 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
     connection->tls_state = MHD_TLS_CONN_INIT;
     MHD_set_https_callbacks (connection);
-    gnutls_init (&connection->tls_session,
-                 flags);
-    gnutls_priority_set (connection->tls_session,
-                         daemon->priority_cache);
+    if ((GNUTLS_E_SUCCESS != gnutls_init (&connection->tls_session, flags)) ||
+        (GNUTLS_E_SUCCESS != gnutls_priority_set (connection->tls_session,
+                                                  daemon->priority_cache)))
+    {
+      gnutls_deinit (connection->tls_session);
+      MHD_socket_close_chk_ (client_socket);
+      MHD_ip_limit_del (daemon,
+                        addr,
+                        addrlen);
+      free (connection->addr);
+      free (connection);
+      MHD_DLOG (connection->daemon,
+                _ ("Failed to initialise TLS session.\n"));
+      errno = EPROTO;
+      return MHD_NO;
+    }
     gnutls_session_set_ptr (connection->tls_session,
     switch (daemon->cred_type)
@@ -2563,6 +2579,7 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
                   "Failed to setup TLS credentials: unknown credential type 
+      gnutls_deinit (connection->tls_session);
       MHD_socket_close_chk_ (client_socket);
       MHD_ip_limit_del (daemon,

To stop receiving notification emails like this one, please contact

reply via email to

[Prev in Thread] Current Thread [Next in Thread]