Re: svn commit: r1920247 - /apr/apr/trunk/ldap/apr_ldap.c
"Graham Leggett via dev" <[email protected]> Wed, 28 Aug 2024 15:47:24 +0200
| Newsgroups | gmane.comp.apache.apr.devel |
|---|---|
| Message-ID | <[email protected]> |
On 28 Aug 2024, at 13:02, Ruediger Pluem <[email protected]> wrote: >> - apr_buffer_mem_set(&buf, vals[k]->bv_val, vals[k]->bv_len); >> -// fixme - tell cb if binary >> + if (binary) { >> + apr_buffer_mem_set(&buf, vals[k]->bv_val, vals[k]->bv_len); >> + } >> + else { >> + str = strndup(vals[k]->bv_val, vals[k]->bv_len); > > Why do we need the strndup? Further up we get the data from ldap_get_values_len(), which gives us fixed length results instead of strings. https://linux.die.net/man/3/ldap_get_values_len Alas ldap_get_values() is deprecated, so we can't use it. Regards, Graham --