summary refs log tree commit diff
path: root/iconvdata/8bit-gap.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/8bit-gap.c')
-rw-r--r--iconvdata/8bit-gap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c
index 137a61b047..d9fe4dd8ae 100644
--- a/iconvdata/8bit-gap.c
+++ b/iconvdata/8bit-gap.c
@@ -71,6 +71,12 @@ struct gap
     uint32_t ch = *((uint32_t *) inptr);				      \
     unsigned char res;							      \
 									      \
+    if (ch >= 0xffff)							      \
+      {									      \
+	/* This is an illegal character.  */				      \
+	result = GCONV_ILLEGAL_INPUT;					      \
+	break;								      \
+      }									      \
     while (ch > rp->end)						      \
       ++rp;								      \
     if (ch < rp->start)							      \