projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f04cb1
)
Don't process surrogate pair chars
author
Denis Kenzior
<denkenz@gmail.com>
Tue, 7 Jul 2009 18:50:09 +0000
(13:50 -0500)
committer
Denis Kenzior
<denkenz@gmail.com>
Tue, 7 Jul 2009 19:33:59 +0000
(14:33 -0500)
These are not valid UCS2 chars
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index
91116d0
..
e817730
100644
(file)
--- 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;