From: Denis Kenzior Date: Thu, 2 Feb 2012 15:17:04 +0000 (-0600) Subject: stkutil: Make valgrind happy X-Git-Tag: 1.4~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3805cd91c7d9fe9ef3c66e1d5a0029129a81e0fc;p=platform%2Fupstream%2Fofono.git stkutil: Make valgrind happy ==29809== Conditional jump or move depends on uninitialised value(s) ==29809== at 0x4E826C: stk_file_iter_next (stkutil.c:212) ==29809== by 0x4E8CF8: parse_dataobj_file_list (stkutil.c:635) ==29809== by 0x4EBA29: parse_dataobj (stkutil.c:2410) ==29809== by 0x4ECFB5: parse_refresh (stkutil.c:2971) ==29809== by 0x4EECA3: parse_command_body (stkutil.c:3826) ==29809== by 0x4EF0DF: stk_command_new_from_pdu (stkutil.c:3948) ==29809== by 0x4D50DA: ofono_stk_proactive_command_handled_notify (stk.c:2885) --- diff --git a/src/stkutil.c b/src/stkutil.c index 2c7be53..a03e9b7 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -208,11 +208,11 @@ static gboolean stk_file_iter_next(struct stk_file_iter *iter) unsigned int i; unsigned char last_type; - /* SIM EFs always start with ROOT MF, 0x3f */ - if (start[iter->pos] != 0x3f) + if (pos + 2 >= max) return FALSE; - if (pos + 2 >= max) + /* SIM EFs always start with ROOT MF, 0x3f */ + if (start[iter->pos] != 0x3f) return FALSE; last_type = 0x3f;