Fix NULL pointer dereference in LDAP lookup code.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 30 Aug 2016 08:03:06 +0000 (10:03 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 30 Aug 2016 08:03:06 +0000 (10:03 +0200)
Fixes bug #3027.

src/ldapupdate.c

index b13f2429c91fc7ba4aa308f9b71f5e0f15d911e3..e8ea64ae2779012888f1c841ba1a8ba7b2a3c0f5 100644 (file)
@@ -407,7 +407,7 @@ Rdn *ldapsvr_modify_dn(GHashTable *hash, gchar *dn) {
        else {
                compare = g_hash_table_lookup(hash, rdn->attribute);
                /* if compare and rdn->attribute are equal then dn removed/empty */
-               if (strcmp(compare, rdn->attribute) != 0) {
+               if (compare != NULL && strcmp(compare, rdn->attribute) != 0) {
                        update_rdn(rdn, compare, rest);
                        return rdn;
                }