summaryrefslogtreecommitdiff
path: root/iconvdata/utf-16.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:23:01 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:23:01 +0000
commit519f6620457d9f84d0125c0c7d01abebaae8efaa (patch)
tree28e2b20214b72aa7a633a5910dba7d2388620a78 /iconvdata/utf-16.c
parent74f331b3ccf81cf9404be03e62bde9efcc0878c2 (diff)
parent68e2fa8ed9dbf0edfdaed0310801e764c12af46e (diff)
Merge commit 'refs/top-bases/t/libc_cleanup' into t/libc_cleanup
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)) \