From 4a8c17a41cd8412247741afbcd8abad77b2a8113 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 20 Oct 2010 14:27:57 +1100 Subject: libcli/ldap Don't try and encode a control with a NULL OID ctrl->oid is set to NULL by the Samba4 rootDSE module when removing controls that should not be exposed over LDAP (to avoid a realloc). Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Wed Oct 20 04:13:44 UTC 2010 on sn-devel-104 --- libcli/ldap/ldap_message.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcli/ldap') diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c index b9f9dff223a..7756e731b24 100644 --- a/libcli/ldap/ldap_message.c +++ b/libcli/ldap/ldap_message.c @@ -167,6 +167,12 @@ static bool ldap_encode_control(void *mem_ctx, struct asn1_data *data, } for (i = 0; handlers[i].oid != NULL; i++) { + if (!ctrl->oid) { + /* not encoding this control, the OID has been + * set to NULL indicating it isn't really + * here */ + return true; + } if (strcmp(handlers[i].oid, ctrl->oid) == 0) { if (!handlers[i].encode) { if (ctrl->critical) { -- cgit