From: Remi Gacogne Date: Mon, 16 Aug 2021 08:01:04 +0000 (+0200) Subject: Fix a warning about catching a polymorphic exception type by value X-Git-Tag: dnsdist-1.7.0-alpha1~67^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10647%2Fhead;p=thirdparty%2Fpdns.git Fix a warning about catching a polymorphic exception type by value ``` 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) { | ^~~~~~~~~~~~~~~ ``` --- 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; }