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.)
Signed-off-by: Gerald Pfeifer gerald@pfeifer.com --- dlls/iphlpapi/iphlpapi_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index c94f869c9f9..720f8147476 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -992,7 +992,8 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG struct nsi_ipv6_forward_key *key6; IP_ADAPTER_GATEWAY_ADDRESS *gw, **gw_next; IP_ADAPTER_PREFIX *prefix, **prefix_next; - DWORD err, count, i, prefix_len, key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6); + DWORD err, count, i, prefix_len = 0; + DWORD key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6); DWORD sockaddr_size = (family == AF_INET) ? sizeof(SOCKADDR_IN) : sizeof(SOCKADDR_IN6); SOCKADDR_INET sockaddr; NET_LUID *luid;