[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-1002-g107b53636

paul at claws-mail.org paul at claws-mail.org
Sun Sep 13 15:01:13 CEST 2020


The branch, gtk3 has been updated
       via  107b53636fcc61503e96b8a13c0ac9889b604b02 (commit)
      from  4ff14ca626d9935f6b59e0e416f2f5c73668bef4 (commit)

Summary of changes:
 src/addr_compl.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 107b53636fcc61503e96b8a13c0ac9889b604b02
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Sep 13 14:07:04 2020 +0200

    fix segv in address completion with a keyring
    
    With my keyring and when entering for example "wk at g", then hitting
    Tab, b_ref->name is NULL and addr_comparison_func segfaults.  I have
    not looked closer at the problem but implemented a straightforward for
    for such cases which makes the function more robust in any case.
    
    The bug was probably triggered by my long expired key
    A4D94E92B0986AB5EE9DCD755DE249965B0358A2 which has several user ids
    with my name and different mail addresses - one user id has no mail
    address though.

diff --git a/src/addr_compl.c b/src/addr_compl.c
index c7a6d41b7..0e379a019 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -232,8 +232,18 @@ static gint addr_comparison_func(gconstpointer a, gconstpointer b)
 	else if (a_weight > b_weight)
 		return 1;
 	else {
-		cmp = strcmp(a_ref->name, b_ref->name);
-		return cmp ? cmp : g_strcmp0(a_ref->address, b_ref->address);
+                if (!a_ref->name || !b_ref->name)
+                  cmp = !!a_ref->name - !!b_ref->name;
+                else
+                  cmp = strcmp(a_ref->name, b_ref->name);
+                if (!cmp)
+                  {
+                    if (!a_ref->address || !b_ref->address)
+                      cmp = !!a_ref->address - !!b_ref->address;
+                    else
+                      cmp = g_strcmp0(a_ref->address, b_ref->address);
+                  }
+                return cmp;
 	}
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list