[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldap_explode_dn crash if there are more than one '=' in a DN component (ITS#3233)

Full_Name: Yoel Jacobsen
Version: 2.2.13,2.2.14
OS: Fedora Core 1, Solaris 9 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

It seems the ldap_explode_dn now crash if a DN component includes more than one
instance of the '=' character.

For instance: cn=uid=yoel_o=org,o=org.

In 2.2.6 ldap_explode_dn return for the above DN the following array:
['cn=uid=yoel_o=org', 'o=org]

In recent versions (verified with 2.2.13 and 2.2.14) it just breaks. 

Test program below (run with a DN to explode as the argument
#include <stdio.h>
#include <ldap.h>

int main(int argc, char **argv)
	char	**result;
	int	i;

	if (argc != 2){
		printf("Usage: %s DN\n", argv[0]);

	result = ldap_explode_dn(argv[1], 0);

	i = 0;

	while(result[i] != NULL){
		printf("%s, ", result[i]);