summaryrefslogtreecommitdiff
path: root/meta-pkgs/boost/patches/patch-CVE-2013-0252_1
blob: 064b33978f6eaf3d669baa91920d77fe171f4120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-CVE-2013-0252_1,v 1.1 2013/02/05 18:49:05 drochner Exp $

https://svn.boost.org/trac/boost/ticket/7743

--- boost/locale/utf.hpp.orig	2012-05-02 13:49:25.000000000 +0000
+++ 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);
             }