summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-07-07 13:50:09 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-07-07 14:33:59 -0500
commit8d88ff2e11f3608ee582c576eba72aaf0b2226db (patch)
tree9c450fccc59c5662066a4f69faf90b8fb5703810 /src/util.c
parent5f04cb1c3ec33b158bb5cea550a41d90415761a2 (diff)
downloadofono-8d88ff2e11f3608ee582c576eba72aaf0b2226db.tar.bz2
Don't process surrogate pair chars
These are not valid UCS2 chars
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;