From 1f5c95d9e92360bb72ad415aca6698af8774b094 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Thu, 17 Jun 2021 15:22:40 -0500 Subject: Always pass a valid URI to gtk_show_uri() This can fix issues like a crash when invalid characters get passed through. --- src/fe-gtk/fe-gtk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } -- cgit 1.4.1