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:
6984643
)
Handle the conversion failure when parsing item
author
Yang Gu
<yang.gu@intel.com>
Tue, 16 Mar 2010 10:01:38 +0000
(18:01 +0800)
committer
Denis Kenzior
<denkenz@gmail.com>
Tue, 16 Mar 2010 20:30:06 +0000
(15:30 -0500)
src/stkutil.c
patch
|
blob
|
history
diff --git
a/src/stkutil.c
b/src/stkutil.c
index
787f7eb
..
ceba2d5
100644
(file)
--- a/
src/stkutil.c
+++ b/
src/stkutil.c
@@
-190,6
+190,7
@@
static gboolean parse_dataobj_item(struct comprehension_tlv_iter *iter,
struct stk_item *item = user;
const unsigned char *data;
unsigned int len;
+ char *utf8;
if (comprehension_tlv_iter_get_tag(iter) !=
STK_DATA_OBJECT_TYPE_ITEM)
@@
-206,7
+207,12
@@
static gboolean parse_dataobj_item(struct comprehension_tlv_iter *iter,
return FALSE;
item->id = data[0];
- item->text = sim_string_to_utf8(data+1, len-1);
+ utf8 = sim_string_to_utf8(data+1, len-1);
+
+ if (utf8 == NULL)
+ return FALSE;
+
+ item->text = utf8;
return TRUE;
}