aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch')
-rw-r--r--main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch b/main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch
new file mode 100644
index 0000000000..25dde60cc8
--- /dev/null
+++ b/main/musl/0060-fix-erroneous-acceptance-of-f4-9x-xx-xx-code-sequenc.patch
@@ -0,0 +1,30 @@
+From 39db00afadc9d8d0456c46eab42b8cb8ff9f375c Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Fri, 1 Sep 2017 17:05:40 -0400
+Subject: [PATCH 2/2] fix erroneous acceptance of f4 9x xx xx code sequences by
+ utf-8 decoder
+
+the DFA table controlling accepted ranges for the f4 prefix used an
+incorrect upper bound of 0xa0 where it should have been 0x90, allowing
+such sequences to be accepted and decoded as non-Unicode-scalar values
+0x110000 through 0x11ffff.
+---
+ src/multibyte/internal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/multibyte/internal.c b/src/multibyte/internal.c
+index 7e1b1c03..2f5aaa91 100644
+--- a/src/multibyte/internal.c
++++ b/src/multibyte/internal.c
+@@ -9,7 +9,7 @@
+ | x )
+ #define F(x) ( ( x>=5 ? 0 : \
+ x==0 ? R(0x90,0xc0) : \
+- x==4 ? R(0x80,0xa0) : \
++ x==4 ? R(0x80,0x90) : \
+ R(0x80,0xc0) ) \
+ | ( R(0x80,0xc0) >> 6 ) \
+ | ( R(0x80,0xc0) >> 12 ) \
+--
+2.13.3
+