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)
This commit is contained in:
Denis Kenzior 2012-02-02 09:17:04 -06:00
parent 6b44e65993
commit 3805cd91c7
1 changed files with 3 additions and 3 deletions

View File

@ -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;