From 6f83f45db4b859839b81f07cc942a49834663ffc Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 13 Jun 2022 13:00:01 -0500 Subject: [PATCH] gsimpleproxyresolver: ensure default proxy is valid It should be either a valid URI, or NULL. Passing empty strings or other invalid URIs is no bueno. --- gio/gsimpleproxyresolver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/gsimpleproxyresolver.c b/gio/gsimpleproxyresolver.c index 931d97453..8de26cb7b 100644 --- a/gio/gsimpleproxyresolver.c +++ b/gio/gsimpleproxyresolver.c @@ -537,6 +537,7 @@ g_simple_proxy_resolver_set_default_proxy (GSimpleProxyResolver *resolver, const gchar *default_proxy) { g_return_if_fail (G_IS_SIMPLE_PROXY_RESOLVER (resolver)); + g_return_if_fail (default_proxy == NULL || g_uri_is_valid (default_proxy, G_URI_FLAGS_NONE, NULL)); g_free (resolver->priv->default_proxy); resolver->priv->default_proxy = g_strdup (default_proxy);