commit 66c9ad84dbe0dd411c584a3587cf2c080e5e9143
parent 60fe2b37f7bfe02c88be278badc82be8dfc39a58
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 18 Aug 2018 10:59:46 +0200
fix where we call gnutls_session_set_ptr to prevent NPE (#5427)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2430,6 +2430,8 @@ internal_add_connection (struct MHD_Daemon *daemon,
);
gnutls_priority_set (connection->tls_session,
daemon->priority_cache);
+ gnutls_session_set_ptr (connection->tls_session,
+ connection);
switch (daemon->cred_type)
{
/* set needed credentials for certificate authentication. */
@@ -2481,8 +2483,6 @@ internal_add_connection (struct MHD_Daemon *daemon,
goto cleanup;
#endif /* ! HTTPS_SUPPORT */
}
- gnutls_session_set_ptr (connection->tls_session,
- connection);
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
/* Firm check under lock. */