summaryrefslogtreecommitdiff
path: root/boost/locale/utf.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/locale/utf.hpp')
-rw-r--r--boost/locale/utf.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/boost/locale/utf.hpp b/boost/locale/utf.hpp
index f156692ffc..f41ee29d58 100644
--- a/boost/locale/utf.hpp
+++ b/boost/locale/utf.hpp
@@ -219,16 +219,22 @@ namespace utf {
if(BOOST_LOCALE_UNLIKELY(p==e))
return incomplete;
tmp = *p++;
+ if (!is_trail(tmp))
+ return illegal;
c = (c << 6) | ( tmp & 0x3F);
case 2:
if(BOOST_LOCALE_UNLIKELY(p==e))
return incomplete;
tmp = *p++;
+ if (!is_trail(tmp))
+ return illegal;
c = (c << 6) | ( tmp & 0x3F);
case 1:
if(BOOST_LOCALE_UNLIKELY(p==e))
return incomplete;
tmp = *p++;
+ if (!is_trail(tmp))
+ return illegal;
c = (c << 6) | ( tmp & 0x3F);
}