]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix potential memory leak in daemon/remote.c and nullpointer dereference in
authorRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 15 Sep 2016 08:39:59 +0000 (08:39 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 15 Sep 2016 08:39:59 +0000 (08:39 +0000)
validator/autotrust.

git-svn-id: file:///svn/unbound/trunk@3856 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
doc/Changelog
validator/autotrust.c

index 4c8375f9046f3d749904292c570d4857cbaf5309..65c4fe4df216a743872a0f33d59e95ea3d463efa 100644 (file)
@@ -245,6 +245,7 @@ daemon_remote_create(struct config_file* cfg)
                /* No certificates are requested */
                if(!SSL_CTX_set_cipher_list(rc->ctx, "aNULL")) {
                        log_crypto_err("Failed to set aNULL cipher list");
+                       daemon_remote_delete(rc);
                        return NULL;
                }
 
@@ -253,6 +254,7 @@ daemon_remote_create(struct config_file* cfg)
                 */
                if(!SSL_CTX_set_tmp_dh(rc->ctx,get_dh2048())) {
                        log_crypto_err("Wanted to set DH param, but failed");
+                       daemon_remote_delete(rc);
                        return NULL;
                }
                return rc;
index f6abd9e7764716b2446e702c5acd30261d7cad69..cd8f84ae9f157139f24c8e9ed1782411b682b3da 100644 (file)
@@ -1,3 +1,7 @@
+15 September 2016: Ralph
+       - fix potential memory leak in daemon/remote.c and nullpointer
+         dereference in validator/autotrust.
+
 13 September 2016: Wouter
        - Silenced flex-generated sign-unsigned warning print with gcc
          diagnostic pragma.
index f76aec2c1f2c4b1d38bbd135f3e554fec94f72d8..da8829cebf250a9a574f06920e9ccca11f44751a 100644 (file)
@@ -430,6 +430,8 @@ find_add_tp(struct val_anchors* anchors, uint8_t* rr, size_t rr_len,
        }
        tp = autr_tp_create(anchors, rr, dname_len, sldns_wirerr_get_class(rr,
                rr_len, dname_len));
+       if(!tp) 
+               return NULL;
        lock_basic_lock(&tp->lock);
        return tp;
 }