diff options
author | dahyeong.kim <dahyeong.kim@samsung.com> | 2013-08-27 14:41:07 +0900 |
---|---|---|
committer | dahyeong.kim <dahyeong.kim@samsung.com> | 2013-08-27 14:41:07 +0900 |
commit | 2c102b0a5b44bcefbddda6f49a68138adaa23ddb (patch) | |
tree | 63342f1b637ee43e8bf82d36f3b5cf10e930737a /boost/locale/utf.hpp | |
parent | 659074f92af8251bf5b4d31b27ae00d1488ba2db (diff) | |
download | boost-2c102b0a5b44bcefbddda6f49a68138adaa23ddb.tar.gz boost-2c102b0a5b44bcefbddda6f49a68138adaa23ddb.tar.bz2 boost-2c102b0a5b44bcefbddda6f49a68138adaa23ddb.zip |
Apply patch to protect invalid UTF8 sequences and overflow of ordered_malloc()submit/tizen/20130827.055530
Signed-off-by: dahyeong.kim <dahyeong.kim@samsung.com>
Diffstat (limited to 'boost/locale/utf.hpp')
-rw-r--r-- | boost/locale/utf.hpp | 6 |
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); } |