summaryrefslogtreecommitdiffstats
path: root/src/lib/util/encode/base_n.cc
diff options
context:
space:
mode:
authorOcean Wang <wanghaidong@cnnic.cn>2011-05-25 09:28:36 +0200
committerOcean Wang <wanghaidong@cnnic.cn>2011-05-25 09:28:36 +0200
commitc4412dfaa0bb8c6e95cb4476e80b648cfa9288f2 (patch)
tree5e972063aab43a7c430f364b57b8f0ac973f8a71 /src/lib/util/encode/base_n.cc
parent[trac838] Add more unit tests to base64 decoding (diff)
downloadkea-c4412dfaa0bb8c6e95cb4476e80b648cfa9288f2.tar.xz
kea-c4412dfaa0bb8c6e95cb4476e80b648cfa9288f2.zip
[trac838] Check the value passed to isspace() is not less than 0
Diffstat (limited to 'src/lib/util/encode/base_n.cc')
-rw-r--r--src/lib/util/encode/base_n.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc
index 0e34181b7d..8da3ea5264 100644
--- a/src/lib/util/encode/base_n.cc
+++ b/src/lib/util/encode/base_n.cc
@@ -174,8 +174,10 @@ public:
return (*this);
}
void skipSpaces() {
- while (base_ != base_end_ &&
- isspace(static_cast<unsigned char>(*base_)))
+ // If *base_ < 0, on Windows platform with Visual Studio compiler
+ // it may trigger _ASSERTE((unsigned)(c + 1) <= 256);
+ // so make sure that the parameter of isspace() is larger than 0
+ while (base_ != base_end_ && ((*base_) >= 0) && isspace(*base_))
{
++base_;
}