From: Otto Moerbeek Date: Wed, 6 Apr 2022 12:00:23 +0000 (+0200) Subject: Only catch NetmaskException and leave out noexcept as OOM situations can still throw X-Git-Tag: rec-4.7.0-beta1~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11509%2Fhead;p=thirdparty%2Fpdns.git Only catch NetmaskException and leave out noexcept as OOM situations can still throw --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index f8c1abef01..3e80da91e4 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -884,7 +884,7 @@ private: } } - void copyTree(const NetmaskTree& rhs) noexcept + void copyTree(const NetmaskTree& rhs) { try { TreeNode *node = rhs.d_root.get(); @@ -896,7 +896,7 @@ private: node = node->traverse_lnr(); } } - catch (...) { + catch (const NetmaskException&) { abort(); } } @@ -970,11 +970,11 @@ public: NetmaskTree() noexcept: d_root(new TreeNode()), d_left(nullptr), d_size(0) { } - NetmaskTree(const NetmaskTree& rhs) noexcept: d_root(new TreeNode()), d_left(nullptr), d_size(0) { + NetmaskTree(const NetmaskTree& rhs): d_root(new TreeNode()), d_left(nullptr), d_size(0) { copyTree(rhs); } - NetmaskTree& operator=(const NetmaskTree& rhs) noexcept { + NetmaskTree& operator=(const NetmaskTree& rhs) { clear(); copyTree(rhs); return *this;