From 8007569e9f7d374456a3fbd172a905173462eb5f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Apr 2024 21:01:08 +0200 Subject: [PATCH] s4:libcli/ldap: ldap4_new_connection() requires a valid lp_ctx Otherwise we'll crash in a lot of places later. Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/libcli/ldap/ldap_client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index db13ad3032f..3c9f91601e6 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -65,6 +65,10 @@ _PUBLIC_ struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx, return NULL; } + if (lp_ctx == NULL) { + return NULL; + } + conn = talloc_zero(mem_ctx, struct ldap_connection); if (conn == NULL) { return NULL;