From: Joseph Sutton Date: Thu, 6 Jul 2023 22:37:09 +0000 (+1200) Subject: libcli/ldap: Don’t try to encode NULL name X-Git-Tag: tevent-0.16.0~1189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6a6dcc0c6bce1a19178a69c3c2b61d43d7da5ea;p=thirdparty%2Fsamba.git libcli/ldap: Don’t try to encode NULL name Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c index c7d86844963..3099086b05b 100644 --- a/libcli/ldap/ldap_message.c +++ b/libcli/ldap/ldap_message.c @@ -546,6 +546,9 @@ _PUBLIC_ bool ldap_encode(struct ldap_message *msg, for (i=0; inum_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;