From 6f3d0c05b7caa8049d75b85aeaf68f2fb6e7943e Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 16 Aug 2021 10:01:04 +0200 Subject: [PATCH] Fix a warning about catching a polymorphic exception type by value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ``` decafsigners.cc: In member function ‘virtual bool DecafED25519DNSCryptoKeyEngine::verify(const string&, const string&) const’: decafsigners.cc:140:11: warning: catching polymorphic type ‘class decaf::CryptoException’ by value [-Wcatch-value=] 140 | } catch(CryptoException) { | ^~~~~~~~~~~~~~~ decafsigners.cc: In member function ‘virtual bool DecafED448DNSCryptoKeyEngine::verify(const string&, const string&) const’: decafsigners.cc:276:11: warning: catching polymorphic type ‘class decaf::CryptoException’ by value [-Wcatch-value=] 276 | } catch(CryptoException) { | ^~~~~~~~~~~~~~~ ``` --- pdns/decafsigners.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/decafsigners.cc b/pdns/decafsigners.cc index 9063c32deb..24df3d6ae2 100644 --- a/pdns/decafsigners.cc +++ b/pdns/decafsigners.cc @@ -137,7 +137,7 @@ bool DecafED25519DNSCryptoKeyEngine::verify(const std::string& msg, const std::s try { pub.verify(sig, message); - } catch(CryptoException) { + } catch(const CryptoException& e) { return false; } @@ -273,7 +273,7 @@ bool DecafED448DNSCryptoKeyEngine::verify(const std::string& msg, const std::str try { pub.verify(sig, message); - } catch(CryptoException) { + } catch(const CryptoException& e) { return false; } -- 2.47.2