Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mms-engine] Fix incorrect parameter in mms_engine_handle_cancel
The cancel method should take a string id, but currently a few functions
are still defined with integer ids, including sendMessage and cancel.
sendMessage correctly converts the integer to a string, but cancel had a
bad cast that resulted in a crash when called with an integer id.

We should fix the parameter types on these methods at some point, which
will require a coordinated change with the MmsHandler. Until then, this
prevents the crash and makes the cancel method work as expected.
  • Loading branch information
John Brooks committed Mar 19, 2014
1 parent 7abc988 commit f9a2ebb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mms-engine/mms_engine.c
Expand Up @@ -288,12 +288,15 @@ gboolean
mms_engine_handle_cancel(
OrgNemomobileMmsEngine* proxy,
GDBusMethodInvocation* call,
const char* id,
int database_id,
MMSEngine* engine)
{
const char *id = NULL;
if (database_id > 0) id = g_strdup_printf("%u", database_id);
MMS_DEBUG_("%s", id);
mms_dispatcher_cancel(engine->dispatcher, id);
org_nemomobile_mms_engine_complete_cancel(proxy, call);
g_free(id);
return TRUE;
}

Expand Down

0 comments on commit f9a2ebb

Please sign in to comment.