[vinagre] Avoid NULL dereference if a URI has no hostname



commit baf3141a33c4f05ce20084269d0290fd83469663
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Mon Apr 11 14:48:08 2011 +0200

    Avoid NULL dereference if a URI has no hostname
    
    Signed-off-by: David King <amigadave amigadave com>

 vinagre/vinagre-connection.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index cbc410b..c7f447e 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -554,7 +554,7 @@ vinagre_connection_split_string (const gchar *uri,
         lport += 5900;
     }
 
-  lhost = ipv6_host[0] ? ipv6_host : (server[0][0] ? server[0] : "localhost");
+  lhost = ipv6_host[0] ? ipv6_host : (server[0] && server[0][0] ? server[0] : "localhost");
 
   *host = g_strdup (lhost);
   *port = lport;



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