summaryrefslogtreecommitdiff
path: root/trust/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/utf8.c')
-rw-r--r--trust/utf8.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/trust/utf8.c b/trust/utf8.c
index b94c3e7..72280b5 100644
--- a/trust/utf8.c
+++ b/trust/utf8.c
@@ -156,6 +156,12 @@ utf8_to_uchar (const char *str,
*/
return -1;
}
+ if ((uch >= 0xd800 && uch <= 0xdfff) || uch > 0x10ffff) {
+ /*
+ * Malformed input; invalid code points.
+ */
+ return -1;
+ }
*uc = uch;
return want;