[gnome-control-center/printers-uri-parse-check] printers: Check whether URI is valid while searching for printers



commit 8f18792433d722f3f25799996b7d790f6b09a862
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
    
    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..96e1721e4 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 && conn)
             {
               THostSearchData *search_data;
 


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