summaryrefslogtreecommitdiff
path: root/iconvdata/utf-16.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 16:29:38 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 16:29:38 +0000
commit7c7d34a16f08f84427b3f617313d9633423ad5eb (patch)
tree2c1ac6a7e6b47a49228b905f12b3604dfa4d1dc3 /iconvdata/utf-16.c
parent6772d640a4f4874166a61f1859e1660a2913a89d (diff)
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixes
Diffstat (limited to 'iconvdata/utf-16.c')
-rw-r--r--iconvdata/utf-16.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/iconvdata/utf-16.c b/iconvdata/utf-16.c
index 2d74a1356e..ed5f5b2f1f 100644
--- a/iconvdata/utf-16.c
+++ b/iconvdata/utf-16.c
@@ -1,5 +1,5 @@
/* Conversion module for UTF-16.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -295,6 +295,12 @@ gconv_end (struct __gconv_step *data)
{ \
uint16_t u2; \
\
+ if (__glibc_unlikely (u1 >= 0xdc00)) \
+ { \
+ /* This is no valid first word for a surrogate. */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
+ \
/* It's a surrogate character. At least the first word says \
it is. */ \
if (__glibc_unlikely (inptr + 4 > inend)) \
@@ -329,6 +335,12 @@ gconv_end (struct __gconv_step *data)
} \
else \
{ \
+ if (__glibc_unlikely (u1 >= 0xdc00)) \
+ { \
+ /* This is no valid first word for a surrogate. */ \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
+ \
/* It's a surrogate character. At least the first word says \
it is. */ \
if (__glibc_unlikely (inptr + 4 > inend)) \