From 60226a0386158e6969ec406e8af5efde4085d15b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 4 Jul 2014 14:04:17 +0100 Subject: [PATCH] ginetsocketaddress: Explicitly initialise flags for getaddrinfo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not a functional change, as the hints field is static and hence automatically initialised to zero — which happens to be what AF_UNSPEC and the unspecified protocol are defined as. However, it’s best to be explicit about this, in case AF_UNSPEC is _not_ defined as zero. https://bugzilla.gnome.org/show_bug.cgi?id=732739 --- gio/ginetsocketaddress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gio/ginetsocketaddress.c b/gio/ginetsocketaddress.c index b2a8a2f59..5cf26f7fe 100644 --- a/gio/ginetsocketaddress.c +++ b/gio/ginetsocketaddress.c @@ -361,7 +361,9 @@ g_inet_socket_address_new_from_string (const char *address, if (G_UNLIKELY (g_once_init_enter (&hints))) { + hints_struct.ai_family = AF_UNSPEC; hints_struct.ai_socktype = SOCK_STREAM; + hints_struct.ai_protocol = 0; hints_struct.ai_flags = AI_NUMERICHOST; g_once_init_leave (&hints, &hints_struct); }