From ac6b1acc1f6972e79776fb5d7f5b85d06fbc8cb7 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Thu, 3 Sep 2015 13:16:37 +0200 Subject: [PATCH] printers: avoid crashes when searching for printers w/ special chars Since the dialog considers just the hostname part from the URL, unespacing the url avoids a backend crash. https://bugzilla.gnome.org/show_bug.cgi?id=754248 --- panels/printers/pp-new-printer-dialog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c index e74cc6560..cdedd7e72 100644 --- a/panels/printers/pp-new-printer-dialog.c +++ b/panels/printers/pp-new-printer-dialog.c @@ -1386,7 +1386,11 @@ parse_uri (const gchar *uri, *port = atoi (position + 1); } - *host = resulting_host; + *host = g_uri_unescape_string (resulting_host, + G_URI_RESERVED_CHARS_GENERIC_DELIMITERS + G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS); + + g_free (resulting_host); return TRUE; }