aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-18 10:59:46 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-18 10:59:46 +0200
commit66c9ad84dbe0dd411c584a3587cf2c080e5e9143 (patch)
tree872615e162c096086b87bac5fb0e8be14cffd062
parent60fe2b37f7bfe02c88be278badc82be8dfc39a58 (diff)
downloadlibmicrohttpd-66c9ad84dbe0dd411c584a3587cf2c080e5e9143.tar.gz
libmicrohttpd-66c9ad84dbe0dd411c584a3587cf2c080e5e9143.zip
fix where we call gnutls_session_set_ptr to prevent NPE (#5427)
-rw-r--r--src/microhttpd/daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 31ed1574..2cbd90fd 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2430,6 +2430,8 @@ internal_add_connection (struct MHD_Daemon *daemon,
2430 ); 2430 );
2431 gnutls_priority_set (connection->tls_session, 2431 gnutls_priority_set (connection->tls_session,
2432 daemon->priority_cache); 2432 daemon->priority_cache);
2433 gnutls_session_set_ptr (connection->tls_session,
2434 connection);
2433 switch (daemon->cred_type) 2435 switch (daemon->cred_type)
2434 { 2436 {
2435 /* set needed credentials for certificate authentication. */ 2437 /* set needed credentials for certificate authentication. */
@@ -2481,8 +2483,6 @@ internal_add_connection (struct MHD_Daemon *daemon,
2481 goto cleanup; 2483 goto cleanup;
2482#endif /* ! HTTPS_SUPPORT */ 2484#endif /* ! HTTPS_SUPPORT */
2483 } 2485 }
2484 gnutls_session_set_ptr (connection->tls_session,
2485 connection);
2486 2486
2487 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); 2487 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
2488 /* Firm check under lock. */ 2488 /* Firm check under lock. */