From e497ad900d66b796935872baf837850a77155b4a Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Tue, 1 Oct 2019 16:45:59 +0200 Subject: [PATCH] printers: Check whether URI is valid while searching for printers Fixes #679 --- panels/printers/pp-new-printer-dialog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c index 93e95e9a8..651c0d8f3 100644 --- a/panels/printers/pp-new-printer-dialog.c +++ b/panels/printers/pp-new-printer-dialog.c @@ -1607,13 +1607,16 @@ search_address (const gchar *text, if (text && text[0] != '\0') { + g_autoptr(GSocketConnectable) conn; gchar *scheme = NULL; gchar *host = NULL; gint port; parse_uri (text, &scheme, &host, &port); - if (host) + conn = g_network_address_parse_uri (host, port, NULL); + + if (host != NULL && conn != NULL) { THostSearchData *search_data; -- 2.22.0