On Mon, Jun 25, 2018 at 12:27:23PM +0200, Jeremie Courreges-Anglas wrote:
> On Mon, Jun 25 2018, Gleydson Soares <[email protected]> wrote:
> > avoid passing NULL to asprintf(3) when there's no parent dn entry,
> > this happens when adding a new naming context and then putting the first
> > rdn in.
> >
> > Jun 24 23:51:23 x250 ldapd: vfprintf %s NULL in "@%.*s,%.*s"
> > Jun 25 00:13:14 x250 ldapd: vfprintf %s NULL in "@%.*s,%.*s"
> 
> Are those log entries the only symptom, or does this problem affect
> ldapd(8) operations?

it doesn't affect anything, just messed up my logs.

> 
> The diff looks correct but more complicated than necessary.  Unless I'm
> missing something the shorter diff below would also help.  Does it work
> for you?

clever!
works for me, i'm going to commit it tonight. thanks,

> 
> 
> Index: index.c
> ===================================================================
> RCS file: /d/cvs/src/usr.sbin/ldapd/index.c,v
> retrieving revision 1.11
> diff -u -p -p -u -r1.11 index.c
> --- index.c   20 Jan 2017 11:55:08 -0000      1.11
> +++ index.c   25 Jun 2018 10:19:00 -0000
> @@ -138,6 +138,7 @@ index_rdn_key(struct namespace *ns, stru
>       if (parent_dn == NULL) {
>               rdnsz = dnsz;
>               pdnsz = 0;
> +             parent_dn = "";
>       } else {
>               rdnsz = parent_dn - (char *)dn->data;
>               pdnsz = dnsz - rdnsz - 1;
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to