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 44303a6..61d158b 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;