1
0
forked from pool/openldap2
openldap2/0017-Resolve-error-handling-in-new-ctx-when-global.patch
Jan Engelhardt 39a91ec86a Accepting request 976504 from home:firstyear:branches:network:ldap
- bsc#1199277 - Resolve segfault when calling new ctx with global ctx
* 0017-Resolve-error-handling-in-new-ctx-when-global.patch

OBS-URL: https://build.opensuse.org/request/show/976504
OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=299
2022-05-22 00:07:21 +00:00

26 lines
812 B
Diff

From 43778f8b24f86af411fb5ed6df69851459abe561 Mon Sep 17 00:00:00 2001
From: William Brown <wbrown@suse.de>
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