On Thu, Jan 27, 2022 at 11:18:53PM +0100, Gerald Pfeifer wrote:
In gateway_and_prefix_addresses_alloc prefix_len isn't set in the error case, but used unconditionally. Avoid this by initializing upon declaration.
(Identified by GCC 12.)
It's actually not used unconditionally, since it's only used if sockaddr.si_family is non-zero, in which case it will have been initialised.
It makes more sense to zero-init where sockaddr in also initialised since we're in a loop.
I've sent in v2.
Huw.