summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 91116d0d..e8177300 100644
--- a/src/util.c
+++ b/src/util.c
@@ -765,6 +765,10 @@ char *sim_string_to_utf8(const unsigned char *buffer, int length)
if (buffer[i] & 0x80) {
c = (buffer[i++] & 0x7f) + ucs2_offset;
+
+ if (c >= 0xd800 && c < 0xe000)
+ return NULL;
+
res_len += UTF8_LENGTH(c);
j += 1;
continue;