On 28 Aug 2024, at 13:02, Ruediger Pluem <rpl...@apache.org> 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
--

Reply via email to