Fix null pointer dereference
authorColin Leroy <colin@colino.net>
Thu, 8 Oct 2015 17:08:42 +0000 (19:08 +0200)
committerColin Leroy <colin@colino.net>
Thu, 8 Oct 2015 17:08:42 +0000 (19:08 +0200)
src/addr_compl.c

index 44303a6a2b2fa0f70240a664b3a327b8d6daa31e..61d158b678c0ecc38807f7ac54739cf62ae5edec 100644 (file)
@@ -187,7 +187,9 @@ static gint weight_addr_match(const address_entry* addr)
        gint    a_weight = addr->address ? strlen(addr->address) : n_weight;
        gchar*  match = NULL;
 
-       match = strcasestr(addr->name, g_completion_prefix);
+       if (addr->name)
+               match = strcasestr(addr->name, g_completion_prefix);
+
        if (match != NULL) {
                if (match == addr->name)
                        n_weight = -4;