Re: bgpd, be more carefule with shutdown reason

2023-08-04 Thread Theo de Raadt
Theo Buehler wrote: > On Fri, Aug 04, 2023 at 11:40:36AM +0200, Claudio Jeker wrote: > > When copying the shutdown reason from ctl_neighbor into the peer struct > > the strlcpy needs a NUL terminated string input. This may not be the case > > so we should be more careful here. > > I see two ways

Re: bgpd, be more carefule with shutdown reason

2023-08-04 Thread Theo Buehler
On Fri, Aug 04, 2023 at 11:40:36AM +0200, Claudio Jeker wrote: > When copying the shutdown reason from ctl_neighbor into the peer struct > the strlcpy needs a NUL terminated string input. This may not be the case > so we should be more careful here. > I see two ways to fix this. > a) force in a

bgpd, be more carefule with shutdown reason

2023-08-04 Thread Claudio Jeker
When copying the shutdown reason from ctl_neighbor into the peer struct the strlcpy needs a NUL terminated string input. This may not be the case so we should be more careful here. I see two ways to fix this. a) force in a NUL before callin strlcpy() as done below. b) use memcpy() and then force