Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154374060
D3399.id8007.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
620 B
Referenced Files
None
Subscribers
None
D3399.id8007.diff
View Options
Index: lib/libc/locale/utf8.c
===================================================================
--- lib/libc/locale/utf8.c
+++ lib/libc/locale/utf8.c
@@ -191,7 +191,7 @@
errno = EILSEQ;
return ((size_t)-1);
}
- if (wch >= 0xd800 && wch <= 0xdfff) {
+ if ((wch >= 0xd800 && wch <= 0xdfff) || wch > 0x10ffff) {
/*
* Malformed input; invalid code points.
*/
@@ -318,6 +318,10 @@
lead = 0xc0;
len = 2;
} else if ((wc & ~0xffff) == 0) {
+ if (wc >= 0xd800 && wc <= 0xdfff) {
+ errno = EILSEQ;
+ return ((size_t)-1);
+ }
lead = 0xe0;
len = 3;
} else if (wc >= 0 && wc <= 0x10ffff) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 4:54 AM (1 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32324654
Default Alt Text
D3399.id8007.diff (620 B)
Attached To
Mode
D3399: Make UTF-8 parsing and generation more strict.
Attached
Detach File
Event Timeline
Log In to Comment