[gnome-control-center/gnome-3-34] printers: Check whether URI is valid while searching for printers



commit 669199ed6d8f022cac4b033acd35082ad7368ca6
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Oct 1 16:45:59 2019 +0200

    printers: Check whether URI is valid while searching for printers
    
    (cherry-picked from e497ad900d66b796935872baf837850a77155b4a)
    
    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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]