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

Re: (ITS#5720) ldap_str2charray calls ldap_utf8_strchr incorrectly



quanah@zimbra.com writes:
> Yes. The calling order was incorrect.  It is supposed to be 
> ldap_utf8_strchr(s, brkstr).

No.  Try this with the new code:
  env LDAPHOST='host1 host2' valgrind clients/tools/ldapwhoami -x
It returns writes past malloced areas in ldap_str2charray().

options.c calls ldap_charray("host1 host2", ", ") to parse that.
It counted the number of commas and spaces in the host string.
With the new code, it instead sums up:

   number of commas in "host1 host2"
 + number of commas in  "ost1 host2"
 + number of commas in   "st1 host2"

etc and you never count spaces.

> Also the outside loop was incorrect.

True.

-- 
Hallvard