summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-06-17 15:22:40 -0500
committerPatrick Griffis <pgriffis@igalia.com>2021-06-17 15:22:40 -0500
commit1f5c95d9e92360bb72ad415aca6698af8774b094 (patch)
tree97a4efed8b012cca62a8e88abdf9f6522f3dbc7e /src
parent09e9d1f749aa2d1ba2daaa114a25c3129dd9c4a9 (diff)
Always pass a valid URI to gtk_show_uri()
This can fix issues like a crash when invalid characters get passed
through.
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/fe-gtk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index ee3e847c..b9945002 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -1071,7 +1071,9 @@ fe_open_url_inner (const char *url)
 #elif defined(__APPLE__)
     osx_show_uri (url);
 #else
-	gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL);
+	char *escaped_url = g_uri_escape_string (url, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS, FALSE);
+	gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, NULL);
+	g_free (escaped_url);
 #endif
 }