From 62a46a7990f4dd0d0003f5b6c7c0e8fae841334b Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Sat, 12 Aug 2023 15:31:44 +0200 Subject: [PATCH] Auth: always initialize id passed to dk.addKey --- pdns/pdnsutil.cc | 11 +++++------ pdns/ws-auth.cc | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index bdf0d3347b..52ea3bd029 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -2265,7 +2265,7 @@ static bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = fals static bool secureZone(DNSSECKeeper& dk, const DNSName& zone) { // temp var for addKey - int64_t id; + int64_t id{-1}; // parse attribute string k_algo = ::arg()["default-ksk-algorithm"]; @@ -3068,7 +3068,7 @@ try return EXIT_FAILURE; } } - int64_t id; + int64_t id{-1}; if (!dk.addKey(zone, keyOrZone, algorithm, id, bits, active, published)) { cerr<<"Adding key failed, perhaps DNSSEC not enabled in configuration?"<