mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 05:02:10 +01:00
simpleproxyresolver: Don't crash on invalid hostname
Check for g_hostname_to_ascii() failure, rather than crashing when checking whether an invalid hostname should go through the proxy. The HTTP library should report the error about the invalid hostname once we actually try to connect to it. https://bugzilla.gnome.org/show_bug.cgi?id=772989
This commit is contained in:
parent
1a99154898
commit
cb8c919952
@ -287,11 +287,13 @@ ignore_host (GSimpleProxyResolver *resolver,
|
||||
|
||||
if (priv->ignore_domains)
|
||||
{
|
||||
length = 0;
|
||||
if (g_hostname_is_non_ascii (host))
|
||||
host = ascii_host = g_hostname_to_ascii (host);
|
||||
length = strlen (host);
|
||||
if (host)
|
||||
length = strlen (host);
|
||||
|
||||
for (i = 0; priv->ignore_domains[i].length; i++)
|
||||
for (i = 0; length > 0 && priv->ignore_domains[i].length; i++)
|
||||
{
|
||||
GSimpleProxyResolverDomain *domain = &priv->ignore_domains[i];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user