1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

libcli/ldap: Don’t try to encode NULL name

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-07-07 10:37:09 +12:00 committed by Andrew Bartlett
parent 40b529f8dd
commit d6a6dcc0c6

View File

@ -546,6 +546,9 @@ _PUBLIC_ bool ldap_encode(struct ldap_message *msg,
for (i=0; i<r->num_attributes; i++) {
struct ldb_message_element *attrib = &r->attributes[i];
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) goto err;
if (attrib->name == NULL) {
goto err;
}
if (!asn1_write_OctetString(data, attrib->name,
strlen(attrib->name))) goto err;
if (!asn1_push_tag(data, ASN1_SET)) goto err;