diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-07-07 13:50:09 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-07-07 14:33:59 -0500 |
commit | 8d88ff2e11f3608ee582c576eba72aaf0b2226db (patch) | |
tree | 9c450fccc59c5662066a4f69faf90b8fb5703810 /src/util.c | |
parent | 5f04cb1c3ec33b158bb5cea550a41d90415761a2 (diff) | |
download | ofono-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |