[glib/mcatanzaro/#2597: 1/3] proxy-test: fix check for simple:// URI scheme




commit d63b39d126f4e2a9318138bc125e3954751fc3fa
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Tue Jun 7 15:07:35 2022 -0500

    proxy-test: fix check for simple:// URI scheme
    
    This has no practical impact, since it's only a test, and none of the
    test code would have hit this bug, but the GTestProxyResolver's check to
    see if the URI scheme is simple:// currently only compares the first
    four bytes of the string, so it's actually only checking for the "simp"
    and would match anything else after that, e.g. "simpleton://". This is
    surely not intended.

 gio/tests/proxy-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/tests/proxy-test.c b/gio/tests/proxy-test.c
index 1793006d49..ed0111def1 100644
--- a/gio/tests/proxy-test.c
+++ b/gio/tests/proxy-test.c
@@ -131,7 +131,7 @@ g_test_proxy_resolver_lookup (GProxyResolver  *resolver,
 
   proxies = g_new (gchar *, 3);
 
-  if (!strncmp (uri, "simple://", 4))
+  if (g_str_has_prefix (uri, "simple://"))
     {
       proxies[0] = g_strdup ("direct://");
       proxies[1] = NULL;


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