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 b13f242..e8ea64a 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;
                }