X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=blobdiff_plain;f=libcli%2Fldap%2Fldap_message.c;h=7756e731b247fd08796c0303d228dd5eaf098d22;hp=b9f9dff223a7fe2007a7981b03972e23c22dd3b9;hb=45227e96c2cff017dd0ecd29d9e93e89d71b7573;hpb=42d1a84a360ed56c123bb7bab6340d9e8425a8c0 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) {