From fe486efadd33a15dd02fb37e0764f1f3535208bb Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 18 Jun 2009 16:55:07 -0500 Subject: [PATCH] Fix another logic bug in SS parser If the passwords do not match, it is still a recognized string, but we must return invalid format --- src/ussd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ussd.c b/src/ussd.c index 0691986d..97c3304b 100644 --- a/src/ussd.c +++ b/src/ussd.c @@ -274,9 +274,17 @@ static gboolean recognized_passwd_change_string(struct ofono_modem *modem, return FALSE; } - if (strcmp(sc, "03") || strlen(dn) || strcmp(sic, sid)) + if (strcmp(sc, "03") || strlen(dn)) return FALSE; + /* If SIC & SID don't match, then we just bail out here */ + if (strcmp(sic, sid)) { + DBusConnection *conn = dbus_gsm_connection(); + DBusMessage *reply = dbus_gsm_invalid_format(msg); + g_dbus_send_message(conn, reply); + return TRUE; + } + while ((l = g_slist_find_custom(l, sia, ss_passwd_entry_find_by_service)) != NULL) { struct ss_passwd_entry *entry = l->data; @@ -317,7 +325,7 @@ static gboolean recognized_control_string(struct ofono_modem *modem, goto out; } - if (*sid != '\0'); + if (*sid != '\0') goto out; while ((l = g_slist_find_custom(l, sc,