--- utf.hpp 2012-05-02 15:49:25.000000000 +0200 +++ utf.hpp.patched 2012-11-27 13:22:24.109523051 +0100 @@ -219,16 +219,22 @@ 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); }