summaryrefslogtreecommitdiffstats
path: root/src/lib/util/encode
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/encode')
-rw-r--r--src/lib/util/encode/base_n.cc4
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;