diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-05-10 18:17:12 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-05-10 18:17:12 -0400 |
commit | 07dbcc3d9644b18e05c1776db2a57fe04d780965 (patch) | |
tree | 3a185d45ca75667c66e86582a0de8fcbc9228e6d /zinflate.h | |
parent | e456cd2275bba020e4ee3cc08381f3269df536b0 (diff) | |
download | cryptopp-git-07dbcc3d9644b18e05c1776db2a57fe04d780965.tar.gz |
Add Inflator::BadDistanceErr exception (Issue 414)
The improved validation and excpetion clears the Address Sanitizer and Undefined Behavior Sanitizer findings
Diffstat (limited to 'zinflate.h')
-rw-r--r-- | zinflate.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -98,8 +98,12 @@ public: Err(ErrorType e, const std::string &s)
: Exception(e, s) {}
};
+ //! \brief Exception thrown when a truncated stream is encountered
class UnexpectedEndErr : public Err {public: UnexpectedEndErr() : Err(INVALID_DATA_FORMAT, "Inflator: unexpected end of compressed block") {}};
+ //! \brief Exception thrown when a bad block is encountered
class BadBlockErr : public Err {public: BadBlockErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in compressed block") {}};
+ //! \brief Exception thrown when an invalid distance is encountered
+ class BadDistanceErr : public Err {public: BadDistanceErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in bit distance") {}};
//! \brief RFC 1951 Decompressor
//! \param attachment the filter's attached transformation
|