ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Zbigniew Jędrzejewski-Szmek 2b6823
From 319dadd4b39ed03271848ca649e4d76de0fbf8ff Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 2b6823
From: Lennart Poettering <lennart@poettering.net>
Zbigniew Jędrzejewski-Szmek 2b6823
Date: Sun, 21 Feb 2016 22:27:01 +0100
Zbigniew Jędrzejewski-Szmek 2b6823
Subject: [PATCH] networkd: make sure we allocate the NTA set before we add
Zbigniew Jędrzejewski-Szmek 2b6823
 items to it
Zbigniew Jędrzejewski-Szmek 2b6823
Zbigniew Jędrzejewski-Szmek 2b6823
See: #2683
Zbigniew Jędrzejewski-Szmek 2b6823
(cherry picked from commit cbbf38aefc7a3d18d68f0d8fffb6b59d77948690)
Zbigniew Jędrzejewski-Szmek 2b6823
---
Zbigniew Jędrzejewski-Szmek 2b6823
 src/network/networkd-network.c | 4 ++++
Zbigniew Jędrzejewski-Szmek 2b6823
 1 file changed, 4 insertions(+)
Zbigniew Jędrzejewski-Szmek 2b6823
Zbigniew Jędrzejewski-Szmek 2b6823
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
Zbigniew Jędrzejewski-Szmek 2b6823
index 4315790093..54f76fe206 100644
Zbigniew Jędrzejewski-Szmek 2b6823
--- a/src/network/networkd-network.c
Zbigniew Jędrzejewski-Szmek 2b6823
+++ b/src/network/networkd-network.c
Zbigniew Jędrzejewski-Szmek 2b6823
@@ -994,6 +994,10 @@ int config_parse_dnssec_negative_trust_anchors(
Zbigniew Jędrzejewski-Szmek 2b6823
                         continue;
Zbigniew Jędrzejewski-Szmek 2b6823
                 }
Zbigniew Jędrzejewski-Szmek 2b6823
 
Zbigniew Jędrzejewski-Szmek 2b6823
+                r = set_ensure_allocated(&n->dnssec_negative_trust_anchors, &dns_name_hash_ops);
Zbigniew Jędrzejewski-Szmek 2b6823
+                if (r < 0)
Zbigniew Jędrzejewski-Szmek 2b6823
+                        return log_oom();
Zbigniew Jędrzejewski-Szmek 2b6823
+
Zbigniew Jędrzejewski-Szmek 2b6823
                 r = set_put(n->dnssec_negative_trust_anchors, w);
Zbigniew Jędrzejewski-Szmek 2b6823
                 if (r < 0)
Zbigniew Jędrzejewski-Szmek 2b6823
                         return log_oom();