diff options
author | Ocean Wang <wanghaidong@cnnic.cn> | 2011-05-04 07:50:48 +0200 |
---|---|---|
committer | Ocean Wang <wanghaidong@cnnic.cn> | 2011-05-04 07:50:48 +0200 |
commit | 0e1eaada6f38f23e7de9404a94b2cd5dd2794879 (patch) | |
tree | 9e0fe9b6e06c283cddebc96803bd966dd0d893c8 /src/lib/util/encode | |
parent | [trac838] check the iterator before deference it (diff) | |
download | kea-0e1eaada6f38f23e7de9404a94b2cd5dd2794879.tar.xz kea-0e1eaada6f38f23e7de9404a94b2cd5dd2794879.zip |
[trac838] Make sure the parameter passed to isspace() is larger than 0 to avoid ASSERT failing on Windows platform.
Diffstat (limited to 'src/lib/util/encode')
-rw-r--r-- | src/lib/util/encode/base_n.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc index 46cb02c92b..a3043a0014 100644 --- a/src/lib/util/encode/base_n.cc +++ b/src/lib/util/encode/base_n.cc @@ -166,7 +166,7 @@ public: {} DecodeNormalizer& operator++() { ++base_; - while (base_ != base_end_ && isspace(*base_)) { + while (base_ != base_end_ && (*base_ > 0) && isspace(*base_)) { ++base_; } if (base_ == base_beginpad_) { @@ -271,7 +271,7 @@ BaseNTransformer<BitsPerChunk, BaseZeroCode, Encoder, Decoder>::decode( isc_throw(BadValue, "Too many " << algorithm << " padding characters: " << input); } - } else if (!isspace(ch)) { + } else if (ch < 0 || !isspace(ch)) { break; } ++srit; |