From: Joseph Sutton Date: Thu, 5 Oct 2023 22:18:10 +0000 (+1300) Subject: Revert "s3:libads: Don’t do first loop iteration if ‘attr’ is NULL" X-Git-Tag: tevent-0.16.0~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=728177088cc9117fe4de99ad4c592fae44b43a88;p=thirdparty%2Fsamba.git Revert "s3:libads: Don’t do first loop iteration if ‘attr’ is NULL" Fixes CID 1547073: Control flow issues (DEADCODE). This reverts commit 184a48d65772f359bd81f83256daada8c9e500b3. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 740bc6bb434..509196834ae 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3176,10 +3176,6 @@ 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;