From 3dececd4f63e99e42aa9c5971747bf7cdfd7450f Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Tue, 30 Sep 2008 19:34:44 +0000
Subject: [PATCH] ITS#5720

---
 CHANGES                     | 1 +
 libraries/libldap/charray.c | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index 0441174d4b..72bd44e1e0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 OpenLDAP 2.4 Change Log
 
 OpenLDAP 2.4.12 Engineering
+	Fixed libldap ldap_utf8_strchar arguments (ITS#5720)
 	Fixed libldap TLS_CRLFILE (ITS#5677)
 	Fixed liblutil executables on Windows (ITS#5604)
 	Fixed liblutil microsecond overflows on Windows (ITS#5668)
diff --git a/libraries/libldap/charray.c b/libraries/libldap/charray.c
index a02a6b94d2..b679f75d83 100644
--- a/libraries/libldap/charray.c
+++ b/libraries/libldap/charray.c
@@ -191,10 +191,10 @@ ldap_str2charray( const char *str_in, const char *brkstr )
 	}
 
 	i = 1;
-	for ( s = str; *s; s++ ) {
-		if ( ldap_utf8_strchr( brkstr, s ) != NULL ) {
-			i++;
-		}
+	for ( s = str; *s; LDAP_UTF8_INCR(s) ) {
+		s = ldap_utf8_strchr( s, brkstr );
+		if ( !s ) break;
+		i++;
 	}
 
 	res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) );
-- 
GitLab