gio: don't accept nonstandard IPv4 "numbers-and-dots" addresses
authorDan Winship <danw@gnome.org>
Wed, 21 Aug 2013 01:36:25 +0000 (21:36 -0400)
committerDan Winship <danw@gnome.org>
Sat, 15 Feb 2014 15:22:24 +0000 (10:22 -0500)
commit5575a3e9cb8ec3d0f0f373cb64e6fedc4c72c0f5
tree8b676124c44973bfce8d0556607c0a9b4f4d2d51
parent5cab3fcec13f9b9b13ebb483498e3e50bc1a4b45
gio: don't accept nonstandard IPv4 "numbers-and-dots" addresses

In addition to the standard "192.168.1.1" format, there are numerous
legacy IPv4 address formats (such as "192.168.257",
"0xc0.0xa8.0x01.0x01", "0300.0250.0001.0001", "3232235777", and
"0xc0a80101"). However, none of these forms are ever used any more
except in phishing attempts. GLib wasn't supposed to be accepting
these addresses (neither g_hostname_is_ip_address() nor
g_inet_address_new_from_string() recognizes them), but getaddrinfo()
accepts them, and so the parts of gio that use getaddrinfo()
accidentally did accept those formats.

Fix GNetworkAddress and GResolver to reject these address formats.

https://bugzilla.gnome.org/show_bug.cgi?id=679957
docs/reference/gio/gio-sections.txt
gio/ginetsocketaddress.c
gio/ginetsocketaddress.h
gio/gnetworkaddress.c
gio/gresolver.c
gio/gthreadedresolver.c
gio/tests/network-address.c