]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r265095, r265167;
authorpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 5 May 2014 14:50:53 +0000 (14:50 +0000)
committerpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 5 May 2014 14:50:53 +0000 (14:50 +0000)
commit1ea4739cfbb843bd9ea08a25b7a1e507f6d34b0c
treee459c6f9d7671fac72a4c257ffe0a77eb7375a11
parentae1eaa0408dd17c3ed0ac7bd4864886fe669bd93
MFC r265095, r265167;

citrus: Avoid invalid code points.

The UTF-8 decoder should not accept byte sequences which decode to
unicode code positions U+D800 to U+DFFF (UTF-16 surrogates).[1]

Contrary to the original OpenBSD patch, we do pass U+FFFE and U+FFFF,
both values are valid "non-characters" [2] and must be mapped through
UTFs.

[1] http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
[2] http://www.unicode.org/faq/private_use.html

Reported by: Stefan Sperling [1]
Thanks to: jilles [2]
Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@265361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/locale/utf8.c