summaryrefslogtreecommitdiff
path: root/libcli/ldap
diff options
context:
space:
mode:
Diffstat (limited to 'libcli/ldap')
-rw-r--r--libcli/ldap/ldap_message.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c
index b9f9dff223..7756e731b2 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) {