tdf#129519 Fix crash during WebDAV lock refresh
- NeonSession is shared amongst several files (if on the same server
instance)
- there's explicit code in DAVSessionFactory::createDAVSession()
to share sessions for same host/target
- so then after a while, locks get refreshed, and session timeout
hits
- first lock -> no prob, ne_auth.c:ah_post_send() has
auth_challenge() failing, returning error, which puts that lock
into m_aRemoveDeferred list
- _but_ ah_post_send() then does a clean_session(), and the next
lock refresh from the same session hits NULLPTR session host
-> so let's delay any sspi_host cleanup until session object gets
freed, instead of just cleaned
Change-Id: Ie257310c47913aef9fcfec92c1722d64b28c4f89
Reviewed-on: https://gerrit.libreoffice.org/85614
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/external/neon/UnpackedTarball_neon.mk b/external/neon/UnpackedTarball_neon.mk
index dacf425..74ac2eb 100644
--- a/external/neon/UnpackedTarball_neon.mk
+++ b/external/neon/UnpackedTarball_neon.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,neon,\
external/neon/ubsan.patch \
external/neon/neon_fix_lock_token_on_if.patch \
external/neon/neon_fix_lock_timeout_windows.patch \
external/neon/neon_fix_sspi_session_timeout.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/neon/neon_fix_sspi_session_timeout.patch b/external/neon/neon_fix_sspi_session_timeout.patch
new file mode 100644
index 0000000..5003fda
--- /dev/null
+++ b/external/neon/neon_fix_sspi_session_timeout.patch
@@ -0,0 +1,22 @@
--- src/ne_auth.c~ 2019-12-05 15:38:50.246997951 +0100
+++ src/ne_auth.c 2019-12-20 06:54:31.555836285 +0100
@@ -300,8 +300,6 @@
sess->sspi_token = NULL;
ne_sspi_destroy_context(sess->sspi_context);
sess->sspi_context = NULL;
- if (sess->sspi_host) ne_free(sess->sspi_host);
- sess->sspi_host = NULL;
#endif
#ifdef HAVE_NTLM
if (sess->ntlm_context) {
@@ -1599,6 +1597,10 @@
}
clean_session(sess);
+#ifdef HAVE_SSPI
+ if (sess->sspi_host) ne_free(sess->sspi_host);
+ sess->sspi_host = NULL;
+#endif
ne_free(sess);
}