[glib/mcatanzaro/#2597: 12/15] proxy-test: fix check for simple:// URI scheme
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/mcatanzaro/#2597: 12/15] proxy-test: fix check for simple:// URI scheme
- Date: Mon, 13 Jun 2022 18:06:56 +0000 (UTC)
commit f6714ef832d3451688af87b29ea9e7048590304a
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]