summaryrefslogtreecommitdiff
path: root/zinflate.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-10 18:17:12 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-10 18:17:12 -0400
commit07dbcc3d9644b18e05c1776db2a57fe04d780965 (patch)
tree3a185d45ca75667c66e86582a0de8fcbc9228e6d /zinflate.h
parente456cd2275bba020e4ee3cc08381f3269df536b0 (diff)
downloadcryptopp-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/zinflate.h b/zinflate.h
index b0879cef..0767d4f9 100644
--- a/zinflate.h
+++ b/zinflate.h
@@ -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