From 184a48d65772f359bd81f83256daada8c9e500b3 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 28 Sep 2023 16:45:19 +1300 Subject: [PATCH] =?utf8?q?s3:libads:=20Don=E2=80=99t=20do=20first=20loop?= =?utf8?q?=20iteration=20if=20=E2=80=98attr=E2=80=99=20is=20NULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source3/libads/ldap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 3f93b06f984..a639cd23dc4 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3176,6 +3176,10 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) for (attr = ldap_first_attribute(ads->ldap.ld, (LDAPMessage *)msg, &ptr); attr; attr = ldap_next_attribute(ads->ldap.ld, (LDAPMessage *)msg, ptr)) { + if (attr == NULL) { + break; + } + /* we ignore the fact that this is utf8, as all attributes are ascii... */ if (strnequal(attr, expected_range_attrib, strlen(expected_range_attrib))) { range_attr = attr; -- 2.47.3