On Fri, Jun 09, 2017 at 04:23:13PM +0200, Martin Pieuchot wrote:
> I couldn't convince myself that rn_search() do not check bits
> after 'mlen' so I added the memset() as you suggested.

It looks like you forgot to put the memset() in the diff.

> @@ -432,14 +440,10 @@ rn_addmask(void *n_arg, int search, int 
>               cp--;
>       mlen = cp - addmask_key;
>       if (mlen <= skip) {
> -             if (m0 >= last_zeroed)
> -                     last_zeroed = mlen;
>               return (mask_rnhead->rnh_nodes);
>       }
> -     if (m0 < last_zeroed)
> -             memset(addmask_key + m0, 0, last_zeroed - m0);
> -     *addmask_key = last_zeroed = mlen;
> -     tm = rn_search(addmask_key, rn_masktop);
> +     SALEN(addmask_key) = mlen;
> +     tm = rn_search(addmask_key, mask_rnhead->rnh_treetop);
>       if (memcmp(addmask_key, tm->rn_key, mlen) != 0)
>               tm = NULL;
>       if (tm || search)

With memset() added, OK bluhm@

Reply via email to