| Message ID | 20251208170320.4696-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers | show |
| Series | [Openvpn-devel,v1] socket: Initialize struct in_addr_t in getaddr() | expand |
This is somewhat of a silly-compiler-syndrome - especially since the
last warning in this area was a true positive, now the addition of
the "if(ai)" clause - which has nothing whatsoever to do with the
return data or not - causes a warning (that we treat fatal) in mingw,
and only in the release builds...
But anyway, this is just a 32bit integer, not in the fast path, and
initializing things is generally a good idea :-)
Tested with the (upcoming) GHA mingw+release builds that reproduceably
fail without this change.
Your patch has been applied to the master branch.
commit e8dc7f35584df1f1cf920636cd5ac7232f0009a9
Author: Frank Lichtenheld
Date: Mon Dec 8 18:03:13 2025 +0100
socket: Initialize struct in_addr_t in getaddr()
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1420
Message-Id: <20251208170320.4696-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34894.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 80c2895..3e90833 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -202,7 +202,7 @@ getaddr(unsigned int flags, const char *hostname, int resolve_retry_seconds, bool *succeeded, struct signal_info *sig_info) { - in_addr_t addr; + in_addr_t addr = { 0 }; int status; status = get_addr_generic(AF_INET, flags, hostname, &addr, NULL, resolve_retry_seconds,