Line position index must be updated the number field is empty. Otherwise
we will read same field again in subsequent calls.
---

Hi,

While testing SIM Phonebook we noticed that Email addresses stored to SIM PB
were not properly parsed by oFono. Root cause for this was 
g_at_result_iter_next_number which did not update iterator's line_pos
attribute when number was missing. As a result, wrong fields were 
read when parsing email field (among others).

Entry was following:

+CPBR: 1,"12356789*#98#*",129,"Esko 
M\303\226rk\303\266",,,,,"M\303\266lkky","longandhardemailaddr...@huhhuhjuu.mobi"

Br,
Paavo

 gatchat/gatresult.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index f992486..fb9f4d5 100644
--- a/gatchat/gatresult.c
+++ b/gatchat/gatresult.c
@@ -281,11 +281,11 @@ gboolean g_at_result_iter_next_number(GAtResultIter 
*iter, gint *number)
                end += 1;
        }
 
+       iter->line_pos = skip_to_next_field(line, end, len);
+
        if (pos == end)
                return FALSE;
 
-       iter->line_pos = skip_to_next_field(line, end, len);
-
        if (number)
                *number = value;
 
-- 
1.7.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to