diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2021-06-17 15:22:40 -0500 |
---|---|---|
committer | Patrick Griffis <pgriffis@igalia.com> | 2021-06-17 15:22:40 -0500 |
commit | 1f5c95d9e92360bb72ad415aca6698af8774b094 (patch) | |
tree | 97a4efed8b012cca62a8e88abdf9f6522f3dbc7e | |
parent | 09e9d1f749aa2d1ba2daaa114a25c3129dd9c4a9 (diff) |
Always pass a valid URI to gtk_show_uri()
This can fix issues like a crash when invalid characters get passed through.
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 4 |
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 } |