mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
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.
This commit is contained in:
parent
8a1f087a31
commit
6f83f45db4
@ -537,6 +537,7 @@ g_simple_proxy_resolver_set_default_proxy (GSimpleProxyResolver *resolver,
|
|||||||
const gchar *default_proxy)
|
const gchar *default_proxy)
|
||||||
{
|
{
|
||||||
g_return_if_fail (G_IS_SIMPLE_PROXY_RESOLVER (resolver));
|
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);
|
g_free (resolver->priv->default_proxy);
|
||||||
resolver->priv->default_proxy = g_strdup (default_proxy);
|
resolver->priv->default_proxy = g_strdup (default_proxy);
|
||||||
|
Loading…
Reference in New Issue
Block a user