[glib/glib-2-72: 36/39] gsimpleproxyresolver: ensure default proxy is valid




commit b4dde579358ccddce10982222a1b35063a3c2dcb
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Mon Jun 13 13:00:01 2022 -0500

    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.
    
    (cherry-picked from commit 6f83f45db4b859839b81f07cc942a49834663ffc)

 gio/gsimpleproxyresolver.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/gio/gsimpleproxyresolver.c b/gio/gsimpleproxyresolver.c
index 6a97ba2c6e..4cd39604ba 100644
--- a/gio/gsimpleproxyresolver.c
+++ b/gio/gsimpleproxyresolver.c
@@ -535,6 +535,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]