summaryrefslogtreecommitdiffstats
path: root/src/stkutil.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-02-02 09:17:04 -0600
committerDenis Kenzior <denkenz@gmail.com>2012-02-02 09:17:04 -0600
commit3805cd91c7d9fe9ef3c66e1d5a0029129a81e0fc (patch)
treea852b7667de5098982e443a86ae3be1c6824363b /src/stkutil.c
parent6b44e65993939b23e54aabae71039f52638c4960 (diff)
downloadofono-3805cd91c7d9fe9ef3c66e1d5a0029129a81e0fc.tar.bz2
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)
Diffstat (limited to 'src/stkutil.c')
-rw-r--r--src/stkutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stkutil.c b/src/stkutil.c
index 2c7be53e..a03e9b7c 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;