Fix crash opening folder (Debian bug #771737)
authorRicardo Mones <ricardo@mones.org>
Thu, 4 Dec 2014 15:02:57 +0000 (16:02 +0100)
committerRicardo Mones <ricardo@mones.org>
Thu, 4 Dec 2014 15:02:57 +0000 (16:02 +0100)
See https://bugs.debian.org/771737 for details.

src/addr_compl.c

index c6a1795..4ca55d5 100644 (file)
@@ -183,7 +183,7 @@ static gint addr_completion_func(const gchar *needle, const gchar *haystack,
  */
 static gint weight_addr_match(const address_entry* addr)
 {
-       gint    n_weight = strlen(addr->name);
+       gint    n_weight = addr->name ? strlen(addr->name): 0;
        gint    a_weight = addr->address ? strlen(addr->address) : n_weight;
        gchar*  match = NULL;