Re: bgpd trigger error on pt_fill abuse

2023-03-28 Thread Theo Buehler
On Tue, Mar 28, 2023 at 06:49:38PM +0200, Claudio Jeker wrote: > I almost stepped into this trap and tried to pt_ref the static memory > returned by pt_fill(). That wont work so better make the code explode. > By setting the refcnt to USHRT_MAX a following pr_ref() call will fail. > Since pt_alloc

bgpd trigger error on pt_fill abuse

2023-03-28 Thread Claudio Jeker
I almost stepped into this trap and tried to pt_ref the static memory returned by pt_fill(). That wont work so better make the code explode. By setting the refcnt to USHRT_MAX a following pr_ref() call will fail. Since pt_alloc copies the passed data structure reset the refcnt to 0 there. I think