Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: bgpd: use unsigned int instead of uint8_t as loop iterator var
To:
tech@openbsd.org
Date:
Thu, 7 May 2026 21:17:37 +0200

Download raw body.

Thread
On Thu, May 07, 2026 at 09:11:28PM +0200, Claudio Jeker wrote:
> I like to move away from using size restricted variables for loop indexes
> and length variables.
> 
> Too often the limited range cause overflows in unexpeced ways. It is
> better to use a default int type instead.
> 
> This converts the uint8_t length vars for iterating over the others
> attribute array to unsigned int. I also added early breaks in the loop in
> two places since after the first NULL all values will be NULL as well.

ok tb