aboutsummaryrefslogtreecommitdiff
path: root/devel/boost-libs
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-04-25 23:50:23 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-04-25 23:50:23 +0000
commit53dde143795f8fcffe37026285587edf223bda8a (patch)
tree2b01c3ff129aa45a3d932e2b4f371e6b57f854ee /devel/boost-libs
parent2b4a63bb7643f37bfce876c12e4c6c1edb9e9280 (diff)
Notes
Diffstat (limited to 'devel/boost-libs')
-rw-r--r--devel/boost-libs/Makefile2
-rw-r--r--devel/boost-libs/files/patch-boost-locale-utf52
2 files changed, 53 insertions, 1 deletions
diff --git a/devel/boost-libs/Makefile b/devel/boost-libs/Makefile
index 93d70e50a72d..da9de87a977f 100644
--- a/devel/boost-libs/Makefile
+++ b/devel/boost-libs/Makefile
@@ -4,7 +4,7 @@
PORTNAME= boost-libs
COMMENT= Free portable C++ libraries (without Boost.Python)
-PORTREVISION= 1
+PORTREVISION= 2
BUILD_DEPENDS+= bjam:${PORTSDIR}/devel/boost-jam
diff --git a/devel/boost-libs/files/patch-boost-locale-utf b/devel/boost-libs/files/patch-boost-locale-utf
new file mode 100644
index 000000000000..7ef51e94797b
--- /dev/null
+++ b/devel/boost-libs/files/patch-boost-locale-utf
@@ -0,0 +1,52 @@
+Index: boost/locale/utf.hpp
+===================================================================
+--- boost/locale/utf.hpp (revision 81589)
++++ boost/locale/utf.hpp (revision 81590)
+@@ -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);
+ }
+
+Index: libs/locale/test/test_codepage_converter.cpp
+===================================================================
+--- libs/locale/test/test_codepage_converter.cpp (revision 81589)
++++ libs/locale/test/test_codepage_converter.cpp (revision 81590)
+@@ -140,6 +140,20 @@
+ TEST_TO("\xf8\x90\x80\x80\x80",illegal); // 400 0000
+ TEST_TO("\xfd\xbf\xbf\xbf\xbf\xbf",illegal); // 7fff ffff
+
++ std::cout << "-- Invalid trail" << std::endl;
++ TEST_TO("\xC2\x7F",illegal);
++ TEST_TO("\xdf\x7F",illegal);
++ TEST_TO("\xe0\x7F\x80",illegal);
++ TEST_TO("\xef\xbf\x7F",illegal);
++ TEST_TO("\xe0\x7F\x80",illegal);
++ TEST_TO("\xef\xbf\x7F",illegal);
++ TEST_TO("\xf0\x7F\x80\x80",illegal);
++ TEST_TO("\xf4\x7f\xbf\xbf",illegal);
++ TEST_TO("\xf0\x90\x7F\x80",illegal);
++ TEST_TO("\xf4\x8f\x7F\xbf",illegal);
++ TEST_TO("\xf0\x90\x80\x7F",illegal);
++ TEST_TO("\xf4\x8f\xbf\x7F",illegal);
++
+ std::cout << "-- Invalid length" << std::endl;
+
+ /// Test that this actually works