]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix a warning about catching a polymorphic exception type by value 10647/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 16 Aug 2021 08:01:04 +0000 (10:01 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 16 Aug 2021 08:01:04 +0000 (10:01 +0200)
```
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

index 9063c32debcdf409c6ee1215caae28f12b04ebdf..24df3d6ae2f37bf65a7f7722f69f9151dbdbb382 100644 (file)
@@ -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;
   }