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

Re: segfault in ldap_back_search() with ENABLE_REWRITE (ITS#2825)

> where?  In any case, one of the reasons of using bervals
> instead of char*s was exactly to avoid having to check for
> NULL pointers and calling strlen() all the times.  Now
> all struct berval*s should be assert()ed, and a null
> berval'ed field should be tested as bv->bv_val == NULL while
> an empty one should be tested as bv->bv_len != 0.  In my
> opinion, a NULL base is totally meaningless; an empty base
> makes sense.

Is it your point that we should change bv->bv_val == NULL 
to bv->bv_len == 0 along with the related codes sometime ?
Currently, berval library codes are also checking bv->bv_val
when it could check bv->bv_len, and there are also some 
cases where bv->bv_len is left uninitialized, making its user
codes unable to rely on bv->bv_len.
- Jong