diff --git a/0017-Resolve-error-handling-in-new-ctx-when-global.patch b/0017-Resolve-error-handling-in-new-ctx-when-global.patch new file mode 100644 index 0000000..6426f8c --- /dev/null +++ b/0017-Resolve-error-handling-in-new-ctx-when-global.patch @@ -0,0 +1,25 @@ +From 43778f8b24f86af411fb5ed6df69851459abe561 Mon Sep 17 00:00:00 2001 +From: William Brown +Date: Thu, 12 May 2022 12:46:57 +1000 +Subject: [PATCH] Resolve error handling in new ctx when global + +--- + libraries/libldap/tls2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c +index 6d36db1984..f18992e781 100644 +--- a/libraries/libldap/tls2.c ++++ b/libraries/libldap/tls2.c +@@ -989,7 +989,7 @@ ldap_pvt_tls_set_option( LDAP *ld, int option, void *arg ) + lo->ldo_tls_ctx = NULL; + errmsg[0] = 0; + rc = ldap_int_tls_init_ctx( lo, *(int *)arg, errmsg ); +- if ( rc && errmsg[0] ) { ++ if ( ld && rc && errmsg[0] ) { + if ( ld->ld_error ) + LDAP_FREE( ld->ld_error ); + ld->ld_error = LDAP_STRDUP( errmsg ); +-- +2.36.1 + diff --git a/openldap2.changes b/openldap2.changes index 542d892..2af6e92 100644 --- a/openldap2.changes +++ b/openldap2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 12 02:48:19 UTC 2022 - William Brown + +- bsc#1199277 - Resolve segfault when calling new ctx with global ctx +* 0017-Resolve-error-handling-in-new-ctx-when-global.patch + ------------------------------------------------------------------- Mon Apr 11 20:52:33 UTC 2022 - Michael Ströder diff --git a/openldap2.spec b/openldap2.spec index bc7fb0d..2ee78f7 100644 --- a/openldap2.spec +++ b/openldap2.spec @@ -56,6 +56,7 @@ Patch3: 0003-LDAPI-socket-location.dif Patch5: 0005-pie-compile.dif Patch8: 0008-In-monitor-backend-do-not-return-Connection0-entries.patch Patch16: 0016-Clear-shared-key-only-in-close-function.patch +Patch17: 0017-Resolve-error-handling-in-new-ctx-when-global.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: argon2-devel @@ -243,6 +244,7 @@ Servers %patch5 -p1 %patch8 -p1 %patch16 -p1 +%patch17 -p1 cp %{SOURCE5} . %build